Exception: Yogurt::UnexpectedObjectType
- Inherits:
-
StandardError
- Object
- StandardError
- Yogurt::UnexpectedObjectType
- Extended by:
- T::Sig
- Defined in:
- lib/yogurt/unexpected_object_type.rb
Instance Attribute Summary collapse
-
#expected_types ⇒ Object
readonly
Returns the value of attribute expected_types.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#observed_type ⇒ Object
readonly
Returns the value of attribute observed_type.
Instance Method Summary collapse
-
#initialize(field:, observed_type:, expected_types:) ⇒ UnexpectedObjectType
constructor
A new instance of UnexpectedObjectType.
Constructor Details
#initialize(field:, observed_type:, expected_types:) ⇒ UnexpectedObjectType
Returns a new instance of UnexpectedObjectType.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/yogurt/unexpected_object_type.rb', line 18 def initialize(field:, observed_type:, expected_types:) @field = T.let(field, Symbol) @observed_type = T.let(observed_type, String) @expected_types = T.let(expected_types, T::Array[String]) super <<~STRING Unexpected type returned in GraphQL response for #{field}. Received: #{observed_type} Expected: #{expected_types.join(', ')} STRING end |
Instance Attribute Details
#expected_types ⇒ Object (readonly)
Returns the value of attribute expected_types.
15 16 17 |
# File 'lib/yogurt/unexpected_object_type.rb', line 15 def expected_types @expected_types end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
9 10 11 |
# File 'lib/yogurt/unexpected_object_type.rb', line 9 def field @field end |
#observed_type ⇒ Object (readonly)
Returns the value of attribute observed_type.
12 13 14 |
# File 'lib/yogurt/unexpected_object_type.rb', line 12 def observed_type @observed_type end |