Class: GraphQL::StaticValidation::FieldsWillMerge::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/static_validation/rules/fields_will_merge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, definition, owner_type, parents) ⇒ Field

Returns a new instance of Field.



22
23
24
25
26
27
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 22

def initialize(node, definition, owner_type, parents)
  @node = node
  @definition = definition
  @owner_type = owner_type
  @parents = parents
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



20
21
22
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 20

def definition
  @definition
end

#nodeObject (readonly)

Returns the value of attribute node.



20
21
22
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 20

def node
  @node
end

#owner_typeObject (readonly)

Returns the value of attribute owner_type.



20
21
22
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 20

def owner_type
  @owner_type
end

#parentsObject (readonly)

Returns the value of attribute parents.



20
21
22
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 20

def parents
  @parents
end

Instance Method Details

#return_typeObject



29
30
31
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 29

def return_type
  @return_type ||= @definition&.type
end

#unwrapped_return_typeObject



33
34
35
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 33

def unwrapped_return_type
  @unwrapped_return_type ||= return_type&.unwrap
end