Class: GraphQL::Schema::LateBoundType

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/schema/late_bound_type.rb

Overview

A stand-in for a type which will be resolved in a given schema, by name. TODO: support argument types too, make this a public API somehow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(local_name) ⇒ LateBoundType

Returns a new instance of LateBoundType.



11
12
13
14
15
# File 'lib/graphql/schema/late_bound_type.rb', line 11

def initialize(local_name)
  @name = local_name
  @to_non_null_type = nil
  @to_list_type = nil
end

Instance Attribute Details

#name ⇒ Object (readonly) Also known as: graphql_name

:nodoc:



9
10
11
# File 'lib/graphql/schema/late_bound_type.rb', line 9

def name
  @name
end

Instance Method Details

#inspect ⇒ Object Also known as: to_s



33
34
35
# File 'lib/graphql/schema/late_bound_type.rb', line 33

def inspect
  "#<LateBoundType @name=#{name}>"
end

#non_null? ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/graphql/schema/late_bound_type.rb', line 37

def non_null?
  false
end

#to_list_type ⇒ Object



25
26
27
# File 'lib/graphql/schema/late_bound_type.rb', line 25

def to_list_type
  @to_list_type ||= GraphQL::Schema::List.new(self)
end

#to_non_null_type ⇒ Object



21
22
23
# File 'lib/graphql/schema/late_bound_type.rb', line 21

def to_non_null_type
  @to_non_null_type ||= GraphQL::Schema::NonNull.new(self)
end

#to_type_signature ⇒ Object



29
30
31
# File 'lib/graphql/schema/late_bound_type.rb', line 29

def to_type_signature
  name
end

#unwrap ⇒ Object



17
18
19
# File 'lib/graphql/schema/late_bound_type.rb', line 17

def unwrap
  self
end