Class: GraphQL::TypeKinds::TypeKind
- Inherits:
-
Object
- Object
- GraphQL::TypeKinds::TypeKind
- 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
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#composite? ⇒ Boolean
Is this TypeKind composed of many values?.
-
#fields? ⇒ Boolean
Does this TypeKind have queryable fields?.
-
#initialize(name, resolves: false, fields: false, wraps: false, input: false) ⇒ TypeKind
constructor
A new instance of TypeKind.
-
#input? ⇒ Boolean
Is this TypeKind a valid query input?.
-
#resolves? ⇒ Boolean
Does this TypeKind have multiple possible implementors?.
- #to_s ⇒ Object
-
#wraps? ⇒ Boolean
Does this TypeKind modify another type?.
Constructor Details
#initialize(name, resolves: false, fields: false, wraps: false, input: false) ⇒ TypeKind
Returns a new instance of TypeKind.
6 7 8 9 10 11 12 13 |
# File 'lib/graphql/type_kinds.rb', line 6 def initialize(name, resolves: false, fields: false, wraps: false, input: false) @name = name @resolves = resolves @fields = fields @wraps = wraps @input = input @composite = fields? || resolves? end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/graphql/type_kinds.rb', line 5 def name @name end |
Instance Method Details
#composite? ⇒ Boolean
Is this TypeKind composed of many values?
25 |
# File 'lib/graphql/type_kinds.rb', line 25 def composite?; @composite; end |
#fields? ⇒ Boolean
Does this TypeKind have queryable fields?
18 |
# File 'lib/graphql/type_kinds.rb', line 18 def fields?; @fields; end |
#input? ⇒ Boolean
Is this TypeKind a valid query input?
22 |
# File 'lib/graphql/type_kinds.rb', line 22 def input?; @input; end |
#resolves? ⇒ Boolean
Does this TypeKind have multiple possible implementors?
16 |
# File 'lib/graphql/type_kinds.rb', line 16 def resolves?; @resolves; end |
#to_s ⇒ Object
23 |
# File 'lib/graphql/type_kinds.rb', line 23 def to_s; @name; end |
#wraps? ⇒ Boolean
Does this TypeKind modify another type?
20 |
# File 'lib/graphql/type_kinds.rb', line 20 def wraps?; @wraps; end |