Class: GraphQLSchema::Field
- Inherits:
-
Object
- Object
- GraphQLSchema::Field
- Includes:
- Deprecatable, NamedHash, WithArgs
- Defined in:
- lib/graphql_schema.rb
Instance Method Summary collapse
-
#initialize(field_hash) ⇒ Field
constructor
A new instance of Field.
- #subfields? ⇒ Boolean
- #type ⇒ Object
Methods included from WithArgs
#args, #optional_args, #required_args
Methods included from Deprecatable
#deprecated?, #deprecation_reason
Methods included from NamedHash
#camelize_name, #classify_name, #description, #name, #to_h, #upcase_name
Constructor Details
#initialize(field_hash) ⇒ Field
Returns a new instance of Field.
118 119 120 |
# File 'lib/graphql_schema.rb', line 118 def initialize(field_hash) @hash = field_hash end |
Instance Method Details
#subfields? ⇒ Boolean
126 127 128 |
# File 'lib/graphql_schema.rb', line 126 def subfields? type.subfields? end |
#type ⇒ Object
122 123 124 |
# File 'lib/graphql_schema.rb', line 122 def type @type ||= TypeDeclaration.new(@hash.fetch('type')) end |