Module: GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces Private

Defined in:
lib/graphql/schema/member/has_interfaces.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#interface_type_membershipsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
94
95
96
97
# File 'lib/graphql/schema/member/has_interfaces.rb', line 89

def interface_type_memberships
  own_tms = super
  inherited_tms = superclass.interface_type_memberships
  if inherited_tms.size > 0
    own_tms + inherited_tms
  else
    own_tms
  end
end

#interfaces(context = GraphQL::Query::NullContext.instance) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/graphql/schema/member/has_interfaces.rb', line 73

def interfaces(context = GraphQL::Query::NullContext.instance)
  visible_interfaces = super
  inherited_interfaces = superclass.interfaces(context)
  if visible_interfaces.any?
    if inherited_interfaces.any?
      visible_interfaces.concat(inherited_interfaces)
      visible_interfaces.uniq!
    end
    visible_interfaces
  elsif inherited_interfaces.any?
    inherited_interfaces
  else
    EmptyObjects::EMPTY_ARRAY
  end
end