Class: GraphQL::Stitching::Shaper

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/stitching/shaper.rb

Instance Method Summary collapse

Constructor Details

#initialize(supergraph:, request:) ⇒ Shaper

Returns a new instance of Shaper.



7
8
9
10
# File 'lib/graphql/stitching/shaper.rb', line 7

def initialize(supergraph:, request:)
  @supergraph = supergraph
  @request = request
end

Instance Method Details

#perform!(raw) ⇒ Object



12
13
14
15
# File 'lib/graphql/stitching/shaper.rb', line 12

def perform!(raw)
  @root_type = @supergraph.schema.root_type_for_operation(@request.operation.operation_type)
  resolve_object_scope(raw, @root_type, @request.operation.selections, @root_type.graphql_name)
end