Class: GraphQL::StaticValidation::FieldsWillMerge::Field
- Inherits:
-
Object
- Object
- GraphQL::StaticValidation::FieldsWillMerge::Field
- Defined in:
- lib/graphql/static_validation/rules/fields_will_merge.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#owner_type ⇒ Object
readonly
Returns the value of attribute owner_type.
-
#parents ⇒ Object
readonly
Returns the value of attribute parents.
Instance Method Summary collapse
- #comparison_key ⇒ Object
-
#initialize(node, definition, owner_type, parents) ⇒ Field
constructor
parentsis only for the legacy check, seelegacy_mutually_exclusive?. - #return_type ⇒ Object
-
#scope ⇒ Object
The types which decide if this field is mutually exclusive with other fields.
- #unwrapped_return_type ⇒ Object
Constructor Details
#initialize(node, definition, owner_type, parents) ⇒ Field
parents is only for the legacy check, see legacy_mutually_exclusive?
28 29 30 31 32 33 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 28 def initialize(node, definition, owner_type, parents) @node = node @definition = definition @owner_type = owner_type @parents = parents end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
25 26 27 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 25 def definition @definition end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
25 26 27 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 25 def node @node end |
#owner_type ⇒ Object (readonly)
Returns the value of attribute owner_type.
25 26 27 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 25 def owner_type @owner_type end |
#parents ⇒ Object (readonly)
Returns the value of attribute parents.
25 26 27 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 25 def parents @parents end |
Instance Method Details
#comparison_key ⇒ Object
48 49 50 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 48 def comparison_key @comparison_key ||= [@node, scope] end |
#return_type ⇒ Object
40 41 42 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 40 def return_type @return_type ||= @definition&.type end |
#scope ⇒ Object
The types which decide if this field is mutually exclusive with other fields
36 37 38 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 36 def scope @parents || @owner_type end |
#unwrapped_return_type ⇒ Object
44 45 46 |
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 44 def unwrapped_return_type @unwrapped_return_type ||= return_type&.unwrap end |