Class: Giraph::Schema

Inherits:
GraphQL::Schema
  • Object
show all
Defined in:
lib/giraph/schema.rb

Overview

GraphQL::Schema wrapper allowing decleration of resolver objects per op type (query or mutation)

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Schema

Extract special arguments for resolver objects, let the rest pass-through



7
8
9
10
11
# File 'lib/giraph/schema.rb', line 7

def initialize(**args)
  @query_resolver = args.delete(:query_resolver)
  @mutation_resolver = args.delete(:mutation_resolver)
  super(GraphQL::Schema.new(**args))
end

Instance Method Details

#execute(query, **args) ⇒ Object

Defer the execution only after setting up context and root_value with resolvers and remote arguments



15
16
17
18
19
20
21
# File 'lib/giraph/schema.rb', line 15

def execute(query, **args)
  args = args
         .merge(with_giraph_root(args))
         .merge(with_giraph_resolvers(args))

  super(query, **args)
end