class GraphQL::TypeKinds::TypeKind

These objects are singletons, eg `GraphQL::TypeKinds::UNION`, `GraphQL::TypeKinds::SCALAR`.

Attributes

description[R]
name[R]

Public Class Methods

new(name, abstract: false, fields: false, wraps: false, input: false, description: nil) click to toggle source
# File lib/graphql/type_kinds.rb, line 8
def initialize(name, abstract: false, fields: false, wraps: false, input: false, description: nil)
  @name = name
  @abstract = abstract
  @fields = fields
  @wraps = wraps
  @input = input
  @composite = fields? || abstract?
  @description = description
end

Public Instance Methods

abstract?() click to toggle source

Is this TypeKind abstract?

# File lib/graphql/type_kinds.rb, line 22
def abstract?; @abstract; end
composite?() click to toggle source

Is this TypeKind composed of many values?

# File lib/graphql/type_kinds.rb, line 31
def composite?; @composite; end
enum?() click to toggle source
# File lib/graphql/type_kinds.rb, line 49
def enum?
  self == TypeKinds::ENUM
end
fields?() click to toggle source

Does this TypeKind have queryable fields?

# File lib/graphql/type_kinds.rb, line 24
def fields?;    @fields;    end
input?() click to toggle source

Is this TypeKind a valid query input?

# File lib/graphql/type_kinds.rb, line 28
def input?;     @input;     end
input_object?() click to toggle source
# File lib/graphql/type_kinds.rb, line 53
def input_object?
  self == TypeKinds::INPUT_OBJECT
end
interface?() click to toggle source
# File lib/graphql/type_kinds.rb, line 41
def interface?
  self == TypeKinds::INTERFACE
end
list?() click to toggle source
# File lib/graphql/type_kinds.rb, line 57
def list?
  self == TypeKinds::LIST
end
non_null?() click to toggle source
# File lib/graphql/type_kinds.rb, line 61
def non_null?
  self == TypeKinds::NON_NULL
end
object?() click to toggle source
# File lib/graphql/type_kinds.rb, line 37
def object?
  self == TypeKinds::OBJECT
end
resolves?() click to toggle source

Does this TypeKind have multiple possible implementors? @deprecated Use `abstract?` instead of `resolves?`.

# File lib/graphql/type_kinds.rb, line 20
def resolves?;  @abstract;  end
scalar?() click to toggle source
# File lib/graphql/type_kinds.rb, line 33
def scalar?
  self == TypeKinds::SCALAR
end
to_s() click to toggle source
# File lib/graphql/type_kinds.rb, line 29
def to_s;       @name;      end
union?() click to toggle source
# File lib/graphql/type_kinds.rb, line 45
def union?
  self == TypeKinds::UNION
end
wraps?() click to toggle source

Does this TypeKind modify another type?

# File lib/graphql/type_kinds.rb, line 26
def wraps?;     @wraps;     end