Class: Yogurt::QueryContainer::InterfacesAndUnionsHaveTypename::Error
- Inherits:
-
GraphQL::StaticValidation::Error
- Object
- GraphQL::StaticValidation::Error
- Yogurt::QueryContainer::InterfacesAndUnionsHaveTypename::Error
- Extended by:
- T::Sig
- Defined in:
- lib/yogurt/query_container/interfaces_and_unions_have_typename.rb
Instance Attribute Summary collapse
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(message, node_name:, path: nil, nodes: [], type: nil) ⇒ Error
constructor
A new instance of Error.
- #to_h ⇒ Object
Constructor Details
#initialize(message, node_name:, path: nil, nodes: [], type: nil) ⇒ Error
Returns a new instance of Error.
28 29 30 31 32 |
# File 'lib/yogurt/query_container/interfaces_and_unions_have_typename.rb', line 28 def initialize(, node_name:, path: nil, nodes: [], type: nil) super(, path: path, nodes: nodes) @node_name = T.let(node_name, String) @type_name = T.let(type, T.nilable(String)) end |
Instance Attribute Details
#node_name ⇒ Object (readonly)
Returns the value of attribute node_name.
17 18 19 |
# File 'lib/yogurt/query_container/interfaces_and_unions_have_typename.rb', line 17 def node_name @node_name end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
14 15 16 |
# File 'lib/yogurt/query_container/interfaces_and_unions_have_typename.rb', line 14 def type_name @type_name end |
Instance Method Details
#code ⇒ Object
47 48 49 |
# File 'lib/yogurt/query_container/interfaces_and_unions_have_typename.rb', line 47 def code "interfaceOrUnionMissingTypename" end |
#to_h ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/yogurt/query_container/interfaces_and_unions_have_typename.rb', line 36 def to_h extensions = { "code" => code, "nodeName" => @node_name } extensions['typeName'] = @type_name if @type_name super.merge({ "extensions" => extensions }) end |