Class: Rails::GraphQL::Type::Scalar::AnyScalar

Inherits:
Rails::GraphQL::Type::Scalar show all
Defined in:
lib/rails/graphql/type/scalar/any_scalar.rb

Overview

Handles any type of data for both input and output

Constant Summary

Constants inherited from Rails::GraphQL::Type

KINDS

Class Method Summary collapse

Methods inherited from Rails::GraphQL::Type::Scalar

deserialize, inspect

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

.as_json(value) ⇒ Object



23
24
25
# File 'lib/rails/graphql/type/scalar/any_scalar.rb', line 23

def as_json(value)
  value.as_json
end

.to_json(value) ⇒ Object



19
20
21
# File 'lib/rails/graphql/type/scalar/any_scalar.rb', line 19

def to_json(value)
  value.to_json
end

.valid_input?(value) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rails/graphql/type/scalar/any_scalar.rb', line 11

def valid_input?(value)
  true
end

.valid_output?(value) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rails/graphql/type/scalar/any_scalar.rb', line 15

def valid_output?(value)
  true
end