Class: Graphlyte::Schema::Field
Overview
A field definition
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#deprecation_reason ⇒ Object
Returns the value of attribute deprecation_reason.
-
#description ⇒ Object
Returns the value of attribute description.
-
#is_deprecated ⇒ Object
Returns the value of attribute is_deprecated.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Field
constructor
A new instance of Field.
Methods inherited from Data
#==, attr_accessor, attr_reader, attributes, #dup, #eql?, #hash, #inspect
Constructor Details
#initialize ⇒ Field
Returns a new instance of Field.
112 113 114 115 116 |
# File 'lib/graphlyte/schema.rb', line 112 def initialize(**) super @arguments ||= {} end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
110 111 112 |
# File 'lib/graphlyte/schema.rb', line 110 def arguments @arguments end |
#deprecation_reason ⇒ Object
Returns the value of attribute deprecation_reason.
109 110 111 |
# File 'lib/graphlyte/schema.rb', line 109 def deprecation_reason @deprecation_reason end |
#description ⇒ Object
Returns the value of attribute description.
109 110 111 |
# File 'lib/graphlyte/schema.rb', line 109 def description @description end |
#is_deprecated ⇒ Object
Returns the value of attribute is_deprecated.
109 110 111 |
# File 'lib/graphlyte/schema.rb', line 109 def is_deprecated @is_deprecated end |
#name ⇒ Object
Returns the value of attribute name.
109 110 111 |
# File 'lib/graphlyte/schema.rb', line 109 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
109 110 111 |
# File 'lib/graphlyte/schema.rb', line 109 def type @type end |
Class Method Details
.from_schema_response(data) ⇒ Object
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/graphlyte/schema.rb', line 118 def self.from_schema_response(data) new( name: data['name'], description: data['description'], type: TypeRef.from_schema_response(data['type']), is_deprecated: data['isDeprecated'], deprecation_reason: data['deprecationReason'], arguments: Schema.entity_map(InputValue, data['arguments']) ) end |