Class: GraphQL::Query::SerialExecution::InlineFragmentResolution
- Inherits:
-
BaseExecution::SelectedObjectResolution
- Object
- BaseExecution::SelectedObjectResolution
- GraphQL::Query::SerialExecution::InlineFragmentResolution
- Defined in:
- lib/graphql/query/serial_execution/inline_fragment_resolution.rb
Instance Attribute Summary collapse
-
#resolved_type ⇒ Object
readonly
Returns the value of attribute resolved_type.
Attributes inherited from BaseExecution::SelectedObjectResolution
#ast_node, #execution_strategy, #parent_type, #query, #target
Instance Method Summary collapse
-
#initialize(ast_node, type, target, query, execution_strategy) ⇒ InlineFragmentResolution
constructor
A new instance of InlineFragmentResolution.
- #result ⇒ Object
Constructor Details
#initialize(ast_node, type, target, query, execution_strategy) ⇒ InlineFragmentResolution
Returns a new instance of InlineFragmentResolution.
6 7 8 9 10 |
# File 'lib/graphql/query/serial_execution/inline_fragment_resolution.rb', line 6 def initialize(ast_node, type, target, query, execution_strategy) super child_type = query.schema.types[ast_node.type] @resolved_type = GraphQL::Query::TypeResolver.new(target, child_type, type).type end |
Instance Attribute Details
#resolved_type ⇒ Object (readonly)
Returns the value of attribute resolved_type.
5 6 7 |
# File 'lib/graphql/query/serial_execution/inline_fragment_resolution.rb', line 5 def resolved_type @resolved_type end |
Instance Method Details
#result ⇒ Object
12 13 14 15 16 17 |
# File 'lib/graphql/query/serial_execution/inline_fragment_resolution.rb', line 12 def result return {} if resolved_type.nil? selections = ast_node.selections resolver = execution_strategy.selection_resolution.new(target, resolved_type, selections, query, execution_strategy) resolver.result end |