Class: GraphQL::Stitching::Shaper

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

Instance Method Summary collapse

Constructor Details

#initialize(schema:, document:) ⇒ Shaper

Returns a new instance of Shaper.



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

def initialize(schema:, document:)
  @schema = schema
  @document = document
end

Instance Method Details

#perform!(raw) ⇒ Object



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

def perform!(raw)
  raw["data"] = resolve_object_scope(raw["data"], @schema.query, @document.operation.selections)
  raw
end