Class: GraphQL::Execution::FieldResult
- Inherits:
-
Object
- Object
- GraphQL::Execution::FieldResult
- Defined in:
- lib/graphql/execution/field_result.rb
Overview
This is one key-value pair in a GraphQL response.
Instance Attribute Summary collapse
-
#field ⇒ GraphQL::Field
readonly
The field which resolved this value.
-
#owner ⇒ SelectionResult
readonly
The result object that this field belongs to.
-
#value ⇒ Any, Lazy
The GraphQL-ready response value, or a Lazy instance.
Instance Method Summary collapse
-
#initialize(field:, value:, owner:) ⇒ FieldResult
constructor
A new instance of FieldResult.
- #inspect ⇒ Object
Constructor Details
#initialize(field:, value:, owner:) ⇒ FieldResult
Returns a new instance of FieldResult.
15 16 17 18 19 |
# File 'lib/graphql/execution/field_result.rb', line 15 def initialize(field:, value:, owner:) @field = field @owner = owner self.value = value end |
Instance Attribute Details
#field ⇒ GraphQL::Field (readonly)
Returns The field which resolved this value.
10 11 12 |
# File 'lib/graphql/execution/field_result.rb', line 10 def field @field end |
#owner ⇒ SelectionResult (readonly)
Returns The result object that this field belongs to.
13 14 15 |
# File 'lib/graphql/execution/field_result.rb', line 13 def owner @owner end |
Instance Method Details
#inspect ⇒ Object
47 48 49 |
# File 'lib/graphql/execution/field_result.rb', line 47 def inspect "#<FieldResult #{value.inspect} (#{field.type})>" end |