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.



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

def initialize(local_name)
  @name = local_name
end

Instance Attribute Details

#nameObject (readonly)



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

def name
  @name
end

Instance Method Details

#inspectObject Also known as: to_s



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

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

#to_list_typeObject



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

def to_list_type
  GraphQL::ListType.new(of_type: self)
end

#to_non_null_typeObject



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

def to_non_null_type
  GraphQL::NonNullType.new(of_type: self)
end

#unwrapObject



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

def unwrap
  self
end