Class: Graphlyte::Schema::Directive
- Defined in:
- lib/graphlyte/schema.rb
Overview
A directive adds metadata to a defintion. See: spec.graphql.org/October2021/#sec-Language.Directives
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Directive
constructor
A new instance of Directive.
Methods inherited from Data
#==, attr_accessor, attr_reader, attributes, #dup, #eql?, #hash, #inspect
Constructor Details
#initialize ⇒ Directive
Returns a new instance of Directive.
15 16 17 18 19 |
# File 'lib/graphlyte/schema.rb', line 15 def initialize(**) super @arguments ||= {} end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
13 14 15 |
# File 'lib/graphlyte/schema.rb', line 13 def arguments @arguments end |
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/graphlyte/schema.rb', line 12 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/graphlyte/schema.rb', line 12 def name @name end |
Class Method Details
.from_schema_response(data) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/graphlyte/schema.rb', line 21 def self.from_schema_response(data) new( name: data['name'], description: data['description'], arguments: Schema.entity_map(InputValue, data['arguments']) ) end |