Class: GraphQL::Execution::FieldResult Private

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/execution/field_result.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This is one key-value pair in a GraphQL response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:, owner:) ⇒ FieldResult

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FieldResult.



13
14
15
16
17
# File 'lib/graphql/execution/field_result.rb', line 13

def initialize(type:, value:, owner:)
  @type = type
  @owner = owner
  self.value = value
end

Instance Attribute Details

#ownerSelectionResult (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The result object that this field belongs to.

Returns:



11
12
13
# File 'lib/graphql/execution/field_result.rb', line 11

def owner
  @owner
end

#valueAny, Lazy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the GraphQL-ready response value, or a Lazy instance.

Returns:

  • (Any, Lazy)

    the GraphQL-ready response value, or a Lazy instance



8
9
10
# File 'lib/graphql/execution/field_result.rb', line 8

def value
  @value
end

Instance Method Details

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



49
50
51
# File 'lib/graphql/execution/field_result.rb', line 49

def inspect
  "#<FieldResult #{value.inspect} (#{@type})>"
end