Class: GraphQL::Stitching::Executor::Shaper Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Shapes the final results payload to the request selection and schema definition. This eliminates unrequested export selections and applies null bubbling.

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ Shaper

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Shaper.



10
11
12
13
14
# File 'lib/graphql/stitching/executor/shaper.rb', line 10

def initialize(request)
  @request = request
  @supergraph = request.supergraph
  @root_type = nil
end

Instance Method Details

#perform!(raw) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
# File 'lib/graphql/stitching/executor/shaper.rb', line 16

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