class GraphQL::Schema::TypeMembership

it is a member.
This class joins an object type to an abstract type (interface or union) of which

def graphql_name

def graphql_name
  "#{@object_type.graphql_name}.#{@abstract_type.kind.interface? ? "implements" : "belongsTo" }.#{@abstract_type.graphql_name}"
end

def initialize(abstract_type, object_type, **options)

Parameters:
  • options (Hash) -- Any options passed to `.possible_types` or `.implements`
  • object_type (Class) --
  • abstract_type (Class, Module) --
def initialize(abstract_type, object_type, **options)
  @abstract_type = abstract_type
  @object_type = object_type
  @options = options
end

def inspect

def inspect
  "#<#{self.class} #{@object_type.inspect} => #{@abstract_type.inspect}>"
end

def path

def path
  graphql_name
end

def visible?(ctx)

Returns:
  • (Boolean) - if false, {#object_type} will be treated as _not_ a member of {#abstract_type}
def visible?(ctx)
  warden = Warden.from_context(ctx)
  (@object_type.respond_to?(:visible?) ? warden.visible_type?(@object_type, ctx) : true) &&
    (@abstract_type.respond_to?(:visible?) ? warden.visible_type?(@abstract_type, ctx) : true)
end