Class: GraphQL::StaticValidation::FieldsWillMergeError
- Defined in:
- lib/graphql/static_validation/rules/fields_will_merge_error.rb
Instance Attribute Summary collapse
-
#conflicts ⇒ Object
readonly
Returns the value of attribute conflicts.
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
Attributes inherited from Error
Instance Method Summary collapse
-
#code ⇒ Object
-
#initialize(message, path: nil, nodes: [], field_name:, conflicts:) ⇒ FieldsWillMergeError
constructor
A new instance of FieldsWillMergeError.
-
#to_h ⇒ Object
A hash representation of this Message.
Constructor Details
#initialize(message, path: nil, nodes: [], field_name:, conflicts:) ⇒ FieldsWillMergeError
Returns a new instance of FieldsWillMergeError
8 9 10 11 12 |
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 8 def initialize(, path: nil, nodes: [], field_name:, conflicts:) super(, path: path, nodes: nodes) @field_name = field_name @conflicts = conflicts end |
Instance Attribute Details
#conflicts ⇒ Object (readonly)
Returns the value of attribute conflicts
6 7 8 |
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 6 def conflicts @conflicts end |
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name
5 6 7 |
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 5 def field_name @field_name end |
Instance Method Details
#code ⇒ Object
27 28 29 |
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 27 def code "fieldConflict" end |
#to_h ⇒ Object
A hash representation of this Message
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 15 def to_h extensions = { "code" => code, "fieldName" => field_name, "conflicts" => conflicts } super.merge({ "extensions" => extensions }) end |