Class: GraphQL::Stitching::Shaper

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

Instance Method Summary collapse

Constructor Details

#initialize(schema:, request:) ⇒ Shaper

Returns a new instance of Shaper.



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

def initialize(schema:, request:)
  @schema = schema
  @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 = @schema.public_send(@request.operation.operation_type)
  resolve_object_scope(raw, root_type, @request.operation.selections)
end