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.

API:

  • private

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.

API:

  • private



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:

  • The result object that this field belongs to

API:

  • private



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:

  • the GraphQL-ready response value, or a Lazy instance

API:

  • private



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.

API:

  • private



45
46
47
# File 'lib/graphql/execution/field_result.rb', line 45

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