class GraphQL::InterfaceType


end
interfaces [DeviceInterface]
Laptoptype = GraphQL::ObjectType.define do
@example Implementing an interface with an object type
end
field :release_year, types.Int
field :processor, ProcessorType
field :ram, types.String
description(“Hardware devices for computing”)
name(“Device”)
DeviceInterface = GraphQL::InterfaceType.define do
@example An interface with three fields
An object type can override the inherited definition by redefining that field.
Objects which implement this field inherit field definitions from the interface.
Interfaces can have fields, defined with ‘field`, just like an object type.
An Interface contains a collection of types which implement some of the same fields.

def all_fields

Returns:
  • (Array) - All fields on this type
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 initialize

def initialize
  super
  @fields = {}
end

def initialize_copy(other)

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

def kind

def kind
  GraphQL::TypeKinds::INTERFACE
end