Skip to content

Instantly share code, notes, and snippets.

@jenny-codes
Last active Mar 19, 2019
Embed
What would you like to do?
class HiSchema < GraphQL::Schema
# default limits
max_depth 10
max_complexity 300
# root types
query Types::Query # required
mutation Types::Mutation # optional
subscription Types::Subscription # optional
# plugins
use GraphQL::Batch
use GraphQL::Tracing::NewRelicTracing
# Define hooks as class methods:
def self.resolve_type(type, obj, ctx)
# ...
end
def self.object_from_id(node_id, ctx)
# ...
end
def self.id_from_object(object, type, ctx)
# ...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment