Module: GraphQL::Schema::SubclassGetReferencesTo

Defined in:
lib/graphql/schema.rb

Instance Method Summary collapse

Instance Method Details

#get_references_to(type_name) ⇒ Object



1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
# File 'lib/graphql/schema.rb', line 1529

def get_references_to(type_name)
  own_refs = @own_references_to[type_name]
  inherited_refs = superclass.references_to(type_name)
  if inherited_refs&.any?
    if own_refs&.any?
      own_refs + inherited_refs
    else
      inherited_refs
    end
  else
    own_refs
  end
end