Class: GraphQL::Stitching::Planner
- Inherits:
-
Object
- Object
- GraphQL::Stitching::Planner
- Defined in:
- lib/graphql/stitching/planner.rb,
lib/graphql/stitching/planner/step.rb
Defined Under Namespace
Classes: ScopePartition, Step
Constant Summary collapse
- SUPERGRAPH_LOCATIONS =
[Supergraph::SUPERGRAPH_LOCATION].freeze
- TYPENAME =
"__typename"
- QUERY_OP =
"query"
- MUTATION_OP =
"mutation"
- ROOT_INDEX =
0
Instance Method Summary collapse
-
#initialize(request) ⇒ Planner
constructor
A new instance of Planner.
- #perform ⇒ Object
- #steps ⇒ Object
Constructor Details
#initialize(request) ⇒ Planner
Returns a new instance of Planner.
14 15 16 17 18 19 |
# File 'lib/graphql/stitching/planner.rb', line 14 def initialize(request) @request = request @supergraph = request.supergraph @planning_index = ROOT_INDEX @steps_by_entrypoint = {} end |
Instance Method Details
#perform ⇒ Object
21 22 23 24 25 |
# File 'lib/graphql/stitching/planner.rb', line 21 def perform build_root_entrypoints Plan.new(ops: steps.map(&:to_plan_op)) end |
#steps ⇒ Object
27 28 29 |
# File 'lib/graphql/stitching/planner.rb', line 27 def steps @steps_by_entrypoint.values.sort_by!(&:index) end |