Class: GraphQL::TypeKinds::TypeKind

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/type_kinds.rb,
lib/graphql/type_kinds.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, resolves: false, fields: false, wraps: false, input: false, description: nil) ⇒ TypeKind

Returns a new instance of TypeKind


7
8
9
10
11
12
13
14
15
# File 'lib/graphql/type_kinds.rb', line 7

def initialize(name, resolves: false, fields: false, wraps: false, input: false, description: nil)
  @name = name
  @resolves = resolves
  @fields = fields
  @wraps = wraps
  @input = input
  @composite = fields? || resolves?
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description


6
7
8
# File 'lib/graphql/type_kinds.rb', line 6

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name


6
7
8
# File 'lib/graphql/type_kinds.rb', line 6

def name
  @name
end

Instance Method Details

#composite?Boolean

Is this TypeKind composed of many values?

Returns:

  • (Boolean)

27
# File 'lib/graphql/type_kinds.rb', line 27

def composite?; @composite; end

#fields?Boolean

Does this TypeKind have queryable fields?

Returns:

  • (Boolean)

20
# File 'lib/graphql/type_kinds.rb', line 20

def fields?;    @fields;    end

#input?Boolean

Is this TypeKind a valid query input?

Returns:

  • (Boolean)

24
# File 'lib/graphql/type_kinds.rb', line 24

def input?;     @input;     end

#resolves?Boolean

Does this TypeKind have multiple possible implementors?

Returns:

  • (Boolean)

18
# File 'lib/graphql/type_kinds.rb', line 18

def resolves?;  @resolves;  end

#to_sObject


25
# File 'lib/graphql/type_kinds.rb', line 25

def to_s;       @name;      end

#wraps?Boolean

Does this TypeKind modify another type?

Returns:

  • (Boolean)

22
# File 'lib/graphql/type_kinds.rb', line 22

def wraps?;     @wraps;     end