Class: GraphQL::Query::SerialExecution::FieldResolution
- Inherits:
-
Object
- Object
- GraphQL::Query::SerialExecution::FieldResolution
- Defined in:
- lib/graphql/query/serial_execution/field_resolution.rb
Defined Under Namespace
Modules: FieldResolveStep
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#irep_node ⇒ Object
readonly
Returns the value of attribute irep_node.
-
#parent_type ⇒ Object
readonly
Returns the value of attribute parent_type.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#execution_context ⇒ Object
GraphQL::Batch depends on this.
-
#initialize(irep_nodes, parent_type, target, query_ctx) ⇒ FieldResolution
constructor
A new instance of FieldResolution.
- #result ⇒ Object
Constructor Details
#initialize(irep_nodes, parent_type, target, query_ctx) ⇒ FieldResolution
Returns a new instance of FieldResolution.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 7 def initialize(irep_nodes, parent_type, target, query_ctx) @irep_node = irep_nodes.first @irep_nodes = irep_nodes @parent_type = parent_type @target = target @field_ctx = query_ctx.spawn(path: query_ctx.path + [irep_node.name], irep_node: irep_node) @query = query_ctx.query @field = @query.get_field(parent_type, irep_node.definition_name) @arguments = @query.arguments_for(irep_node, @field) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
5 6 7 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 5 def arguments @arguments end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
5 6 7 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 5 def field @field end |
#irep_node ⇒ Object (readonly)
Returns the value of attribute irep_node.
5 6 7 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 5 def irep_node @irep_node end |
#parent_type ⇒ Object (readonly)
Returns the value of attribute parent_type.
5 6 7 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 5 def parent_type @parent_type end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
5 6 7 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 5 def query @query end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
5 6 7 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 5 def target @target end |
Instance Method Details
#execution_context ⇒ Object
GraphQL::Batch depends on this
25 26 27 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 25 def execution_context @field_ctx end |
#result ⇒ Object
18 19 20 21 22 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 18 def result result_name = irep_node.name raw_value = get_raw_value { result_name => get_finished_value(raw_value) } end |