Class: GraphQL::Stitching::Planner::Step
- Inherits:
-
Object
- Object
- GraphQL::Stitching::Planner::Step
- Defined in:
- lib/graphql/stitching/planner/step.rb
Overview
A planned step in the sequence of stitching entrypoints together. This is a mutable object that may change throughout the planning process. It ultimately builds an immutable Plan::Op at the end of planning.
Constant Summary collapse
- GRAPHQL_PRINTER =
GraphQL::Language::Printer.new
Instance Attribute Summary collapse
-
#after ⇒ Object
Returns the value of attribute after.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#operation_type ⇒ Object
readonly
Returns the value of attribute operation_type.
-
#parent_type ⇒ Object
readonly
Returns the value of attribute parent_type.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#resolver ⇒ Object
Returns the value of attribute resolver.
-
#selections ⇒ Object
Returns the value of attribute selections.
-
#variables ⇒ Object
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(location:, parent_type:, index:, after: nil, operation_type: QUERY_OP, selections: [], variables: {}, path: [], resolver: nil) ⇒ Step
constructor
A new instance of Step.
- #to_plan_op ⇒ Object
Constructor Details
#initialize(location:, parent_type:, index:, after: nil, operation_type: QUERY_OP, selections: [], variables: {}, path: [], resolver: nil) ⇒ Step
Returns a new instance of Step.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/graphql/stitching/planner/step.rb', line 14 def initialize( location:, parent_type:, index:, after: nil, operation_type: QUERY_OP, selections: [], variables: {}, path: [], resolver: nil ) @location = location @parent_type = parent_type @index = index @after = after @operation_type = operation_type @selections = selections @variables = variables @path = path @resolver = resolver end |
Instance Attribute Details
#after ⇒ Object
Returns the value of attribute after.
12 13 14 |
# File 'lib/graphql/stitching/planner/step.rb', line 12 def after @after end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
11 12 13 |
# File 'lib/graphql/stitching/planner/step.rb', line 11 def index @index end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
11 12 13 |
# File 'lib/graphql/stitching/planner/step.rb', line 11 def location @location end |
#operation_type ⇒ Object (readonly)
Returns the value of attribute operation_type.
11 12 13 |
# File 'lib/graphql/stitching/planner/step.rb', line 11 def operation_type @operation_type end |
#parent_type ⇒ Object (readonly)
Returns the value of attribute parent_type.
11 12 13 |
# File 'lib/graphql/stitching/planner/step.rb', line 11 def parent_type @parent_type end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/graphql/stitching/planner/step.rb', line 11 def path @path end |
#resolver ⇒ Object
Returns the value of attribute resolver.
12 13 14 |
# File 'lib/graphql/stitching/planner/step.rb', line 12 def resolver @resolver end |
#selections ⇒ Object
Returns the value of attribute selections.
12 13 14 |
# File 'lib/graphql/stitching/planner/step.rb', line 12 def selections @selections end |
#variables ⇒ Object
Returns the value of attribute variables.
12 13 14 |
# File 'lib/graphql/stitching/planner/step.rb', line 12 def variables @variables end |
Instance Method Details
#to_plan_op ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/graphql/stitching/planner/step.rb', line 36 def to_plan_op GraphQL::Stitching::Plan::Op.new( step: @index, after: @after, location: @location, operation_type: @operation_type, selections: rendered_selections, variables: rendered_variables, path: @path, if_type: type_condition, resolver: @resolver&.version, ) end |