add questions query
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user