add questions query

This commit is contained in:
João Geonizeli
2022-07-21 14:26:03 -03:00
parent 63c5fa52b8
commit 84a3815835
15 changed files with 177 additions and 14 deletions

View File

@@ -16,22 +16,23 @@ class ProgressTestSchema < GraphQL::Schema
# Union and Interface Resolution
def self.resolve_type(abstract_type, obj, ctx)
# TODO: Implement this method
# to return the correct GraphQL object type for `obj`
raise(GraphQL::RequiredImplementationMissingError)
case obj
when Question
Types::QuestionType
else
raise("Unexpected object: #{obj}")
end
end
# Relay-style Object Identification:
# Return a string UUID for `object`
def self.id_from_object(object, type_definition, query_ctx)
# For example, use Rails' GlobalID library (https://github.com/rails/globalid):
object.to_gid_param
end
# Given a string UUID, find the object
def self.object_from_id(global_id, query_ctx)
# For example, use Rails' GlobalID library (https://github.com/rails/globalid):
GlobalID.find(global_id)
end
end