Class: GraphQL::Query::SerialExecution::FieldResolution
- Inherits:
-
Object
- Object
- GraphQL::Query::SerialExecution::FieldResolution
- Defined in:
- lib/graphql/query/serial_execution/field_resolution.rb
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(selection, parent_type, target, query_ctx) ⇒ FieldResolution
constructor
A new instance of FieldResolution.
-
#result ⇒ Object
Constructor Details
#initialize(selection, parent_type, target, query_ctx) ⇒ FieldResolution
Returns a new instance of FieldResolution
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 8 def initialize(selection, parent_type, target, query_ctx) @irep_node = selection @selection = selection @parent_type = parent_type @target = target @query = query_ctx.query @field = irep_node.definition @field_ctx = query_ctx.spawn_child( key: irep_node.name, object: target, irep_node: irep_node, ) @arguments = @query.arguments_for(irep_node, @field) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments
6 7 8 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 6 def arguments @arguments end |
#field ⇒ Object (readonly)
Returns the value of attribute field
6 7 8 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 6 def field @field end |
#irep_node ⇒ Object (readonly)
Returns the value of attribute irep_node
6 7 8 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 6 def irep_node @irep_node end |
#parent_type ⇒ Object (readonly)
Returns the value of attribute parent_type
6 7 8 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 6 def parent_type @parent_type end |
#query ⇒ Object (readonly)
Returns the value of attribute query
6 7 8 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 6 def query @query end |
#target ⇒ Object (readonly)
Returns the value of attribute target
6 7 8 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 6 def target @target end |
Instance Method Details
#execution_context ⇒ Object
GraphQL::Batch depends on this
34 35 36 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 34 def execution_context @field_ctx end |
#result ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 23 def result result_name = irep_node.name raw_value = get_raw_value if raw_value.is_a?(GraphQL::Execution::Execute::Skip) {} else { result_name => get_finished_value(raw_value) } end end |