class GraphQL::InterfaceType

@api deprecated

def all_fields

Returns:
  • (Array) - All fields on this type

Other tags:
    See: [Schema#get_fields] - Get fields with instrumentation
def all_fields
  fields.values
end

def get_field(field_name)

Returns:
  • (GraphQL::Field) - The defined field for `field_name`
def get_field(field_name)
  fields[field_name]
end

def get_possible_type(type_name, ctx)

Returns:
  • (GraphQL::ObjectType, nil) - The type named `type_name` if it exists and implements this {InterfaceType}, (else `nil`)

Parameters:
  • ctx (GraphQL::Query::Context) -- The context for the current query
  • type_name (String) --
def get_possible_type(type_name, ctx)
  type = ctx.query.get_type(type_name)
  type if type && ctx.query.warden.possible_types(self).include?(type)
end

def initialize

def initialize
  super
  @fields = {}
  @orphan_types = []
  @resolve_type_proc = nil
end

def initialize_copy(other)

def initialize_copy(other)
  super
  @fields = other.fields.dup
  @orphan_types = other.orphan_types.dup
end

def kind

def kind
  GraphQL::TypeKinds::INTERFACE
end

def possible_type?(type, ctx)

Returns:
  • (Boolean) - True if the `type` exists and is a member of this {InterfaceType}, (else `nil`)

Parameters:
  • ctx (GraphQL::Query::Context) -- The context for the current query
  • type (String, GraphQL::BaseType) -- Name of the type or a type definition
def possible_type?(type, ctx)
  type_name = type.is_a?(String) ? type : type.graphql_name
  !get_possible_type(type_name, ctx).nil?
end

def resolve_type(value, ctx)

def resolve_type(value, ctx)
  ctx.query.resolve_type(self, value)
end

def resolve_type=(resolve_type_callable)

def resolve_type=(resolve_type_callable)
  @resolve_type_proc = resolve_type_callable
end

def type_membership_class

def type_membership_class
  @type_membership_class || GraphQL::Schema::TypeMembership
end