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
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#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, description: nil) ⇒ 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, description: nil) ⇒ TypeKind
Returns a new instance of TypeKind.
8 9 10 11 12 13 14 15 16 |
# File 'lib/graphql/type_kinds.rb', line 8 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
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/graphql/type_kinds.rb', line 7 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/graphql/type_kinds.rb', line 7 def name @name end |
Instance Method Details
#composite? ⇒ Boolean
Is this TypeKind composed of many values?
28 |
# File 'lib/graphql/type_kinds.rb', line 28 def composite?; @composite; end |
#fields? ⇒ Boolean
Does this TypeKind have queryable fields?
21 |
# File 'lib/graphql/type_kinds.rb', line 21 def fields?; @fields; end |
#input? ⇒ Boolean
Is this TypeKind a valid query input?
25 |
# File 'lib/graphql/type_kinds.rb', line 25 def input?; @input; end |
#resolves? ⇒ Boolean
Does this TypeKind have multiple possible implementors?
19 |
# File 'lib/graphql/type_kinds.rb', line 19 def resolves?; @resolves; end |
#to_s ⇒ Object
26 |
# File 'lib/graphql/type_kinds.rb', line 26 def to_s; @name; end |
#wraps? ⇒ Boolean
Does this TypeKind modify another type?
23 |
# File 'lib/graphql/type_kinds.rb', line 23 def wraps?; @wraps; end |