Module: GraphQL::Schema::SubclassGetReferencesTo

Defined in:
lib/graphql/schema.rb

Instance Method Summary collapse

Instance Method Details

#get_references_to(type_defn) ⇒ Object



1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
# File 'lib/graphql/schema.rb', line 1594

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