graphql/type/scalars

Functions

isSpecifiedScalarType()

Returns true when the scalar type is one of the scalars specified by GraphQL.

Signature:

isSpecifiedScalarType(type: GraphQLNamedType): boolean

Arguments

NameTypeDescription
typeGraphQLNamedTypeThe GraphQL type to inspect.

Returns

TypeDescription
booleanTrue when the value matches this type.

Example

import { isSpecifiedScalarType, GraphQLString } from 'graphql/type';
 
const result = isSpecifiedScalarType(GraphQLString);
 
// result: true for matching GraphQL types

Constants

GRAPHQL_MAX_INT

Maximum possible Int value as per GraphQL Spec (32-bit signed integer). n.b. This differs from JavaScript’s numbers that are IEEE 754 doubles safe up-to 2^53 - 1

2147483647

GRAPHQL_MIN_INT

Minimum possible Int value as per GraphQL Spec (32-bit signed integer). n.b. This differs from JavaScript’s numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)

-2147483648

GraphQLInt

The built-in Int scalar type.

GraphQLScalarType<number, number>

GraphQLFloat

The built-in Float scalar type.

GraphQLScalarType<number, number>

GraphQLString

The built-in String scalar type.

GraphQLScalarType<string, string>

GraphQLBoolean

The built-in Boolean scalar type.

GraphQLScalarType<boolean, boolean>

GraphQLID

The built-in ID scalar type.

GraphQLScalarType<string, string>

specifiedScalarTypes

All built-in scalar types defined by the GraphQL specification.

ReadonlyArray<GraphQLScalarType>