Class: GraphQL::Query::SerialExecution::FieldResolution
- Inherits:
-
BaseExecution::SelectedObjectResolution
- Object
- BaseExecution::SelectedObjectResolution
- GraphQL::Query::SerialExecution::FieldResolution
- Defined in:
- lib/graphql/query/serial_execution/field_resolution.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Attributes inherited from BaseExecution::SelectedObjectResolution
#ast_node, #execution_strategy, #parent_type, #query, #target
Instance Method Summary collapse
-
#initialize(ast_node, parent_type, target, query, execution_strategy) ⇒ FieldResolution
constructor
A new instance of FieldResolution.
- #result ⇒ Object
Constructor Details
#initialize(ast_node, parent_type, target, query, execution_strategy) ⇒ FieldResolution
Returns a new instance of FieldResolution.
7 8 9 10 11 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 7 def initialize(ast_node, parent_type, target, query, execution_strategy) super @field = query.schema.get_field(parent_type, ast_node.name) || raise("No field found on #{parent_type.name} '#{parent_type}' for '#{ast_node.name}'") @arguments = GraphQL::Query::Arguments.new(ast_node.arguments, field.arguments, query.variables) 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 |
Instance Method Details
#result ⇒ Object
13 14 15 16 17 |
# File 'lib/graphql/query/serial_execution/field_resolution.rb', line 13 def result result_name = ast_node.alias || ast_node.name result_value = get_finished_value(get_raw_value) { result_name => result_value } end |