Class: Rails::GraphQL::Type::Object::InputValueObject

Inherits:
Rails::GraphQL::Type::Object show all
Defined in:
lib/rails/graphql/type/object/input_value_object.rb

Overview

The introspection object for a input object

Constant Summary

Constants inherited from Rails::GraphQL::Type

KINDS

Instance Attribute Summary

Attributes included from Helpers::Instantiable

#event

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Rails::GraphQL::Type::Object

=~, implements, implements?, inspect

Methods included from Helpers::WithAssignment

#assigned?, #assigned_class, #assigned_to, #assigned_to=, extended, #register!, #safe_assigned_class, #valid_assignment?

Methods included from Helpers::WithFields

#change_field, #configure_field, #disable_fields, #enable_fields, #enabled_fields, extended, #field, #field_names, #find_by_gid, #find_field, #find_field!, #has_field?, #import, #import_all, #proxy_field, #safe_field, #validate!

Methods inherited from Rails::GraphQL::Type

=~, base_type, create!, decorate, find_by_gid, gid_base_class, input_type?, kind, kind_enum, leaf_type?, operational?, output_type?, to_gql_backtrace

Methods included from Helpers::WithDirectives

#all_directive_events, #all_directive_listeners, #directive_events?, #directive_listeners?, extended, included, #initialize_copy, #use, #using?, #validate!

Methods included from Helpers::WithGlobalID

#to_gid_param, #to_global_id

Methods included from Helpers::Registerable

#aliases, extended, #inherited, #register!, #registered?

Class Method Details

.valid_member?(value) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rails/graphql/type/object/input_value_object.rb', line 11

def self.valid_member?(value)
  value.is_a?(GraphQL::Argument) || super
end

Instance Method Details

#build_typeObject



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/rails/graphql/type/object/input_value_object.rb', line 34

def build_type
  result = current.type_klass

  if current.array?
    result = fake_type_object(:non_null, result) unless current.nullable?
    result = fake_type_object(:list,     result)
  end

  result = fake_type_object(:non_null, result) unless current.null?
  result
end

#default_valueObject



30
31
32
# File 'lib/rails/graphql/type/object/input_value_object.rb', line 30

def default_value
  current.to_json if current.default_value?
end