Class: GraphQL::Language::Value

Inherits:
Struct
  • Object
show all
Defined in:
lib/graphql/language/value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



3
4
5
# File 'lib/graphql/language/value.rb', line 3

def kind
  @kind
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



3
4
5
# File 'lib/graphql/language/value.rb', line 3

def value
  @value
end

Instance Method Details

#materialize(type, variables) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/graphql/language/value.rb', line 6

def materialize(type, variables)
  case type
  when GraphQLNonNull
    materialize(type.of_type, variables)
  when GraphQLList
    value.map { |value| value.materialize(type.of_type, variables) }
  when GraphQLInputObjectType
    raise "Not. Implemented. Yet."
  when GraphQLScalarType, GraphQLEnumType
    type.parse_literal(self)
  else
    raise "Must be input type"
  end
end