Class: Graphlyte::Schema::InputValue

Inherits:
Data
  • Object
show all
Defined in:
lib/graphlyte/schema.rb

Overview

An input value defines the values of arguments and the fields of input objects.

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Data

#==, attr_accessor, attr_reader, attributes, #dup, #eql?, #hash, #initialize, #inspect

Constructor Details

This class inherits a constructor from Graphlyte::Data

Instance Attribute Details

#default_valueObject

Returns the value of attribute default_value.



32
33
34
# File 'lib/graphlyte/schema.rb', line 32

def default_value
  @default_value
end

#descriptionObject

Returns the value of attribute description.



32
33
34
# File 'lib/graphlyte/schema.rb', line 32

def description
  @description
end

#nameObject

Returns the value of attribute name.



32
33
34
# File 'lib/graphlyte/schema.rb', line 32

def name
  @name
end

#typeObject

Returns the value of attribute type.



32
33
34
# File 'lib/graphlyte/schema.rb', line 32

def type
  @type
end

Class Method Details

.from_schema_response(data) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/graphlyte/schema.rb', line 34

def self.from_schema_response(data)
  value = new

  value.name = data['name']
  value.description = data['description']
  value.default_value = data['defaultValue']
  value.type = TypeRef.from_schema_response(data['type'])

  value
end