Class: GraphQL::Schema::Scalar Private

Inherits:
Member
  • Object
show all
Extended by:
Forwardable, Member::AcceptsDefinition
Defined in:
lib/graphql/schema/scalar.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary

Constants included from Member::GraphQLTypeNames

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

Class Method Summary collapse

Methods included from Member::TypeSystemHelpers

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type

Methods included from Member::BaseDSLMethods

#description, #graphql_name, #introspection, #mutation, #name, #overridden_graphql_name, #to_graphql, #unwrap

Methods included from Relay::TypeExtensions

#connection_type, #define_connection, #define_edge, #edge_type

Methods included from Member::CachedGraphQLDefinition

#graphql_definition, #initialize_copy

Class Method Details

.coerce_input(val, ctx) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/graphql/schema/scalar.rb', line 11

def coerce_input(val, ctx)
  val
end

.coerce_result(val, ctx) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/graphql/schema/scalar.rb', line 15

def coerce_result(val, ctx)
  val
end

.kindObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/graphql/schema/scalar.rb', line 29

def kind
  GraphQL::TypeKinds::SCALAR
end

.to_graphqlObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
24
25
26
27
# File 'lib/graphql/schema/scalar.rb', line 19

def to_graphql
  type_defn = GraphQL::ScalarType.new
  type_defn.name = graphql_name
  type_defn.description = description
  type_defn.coerce_result = method(:coerce_result)
  type_defn.coerce_input = method(:coerce_input)
  type_defn.[:type_class] = self
  type_defn
end