Latest
class GraphQLScalarType
import { GraphQLScalarType } from "https://dotland.deno.dev/x/graphql_deno@v15.0.0/lib/type/definition.d.ts";

Scalar Type Definition

The leaf values of any request and input values to arguments are Scalars (or Enums) and are defined with a name and a series of functions used to parse input from ast or variables and to ensure validity.

Example:

const OddType = new GraphQLScalarType({
  name: 'Odd',
  serialize(value) {
    return value % 2 === 1 ? value : null;
  }
});

Constructors

new
GraphQLScalarType(config: Readonly<GraphQLScalarTypeConfig<any, any>>)

Properties

description: Maybe<string>
extensionASTNodes: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>
extensions: Maybe<Readonly<Record<string, any>>>
name: string
parseLiteral: GraphQLScalarLiteralParser<any>
parseValue: GraphQLScalarValueParser<any>
serialize: GraphQLScalarSerializer<any>

Methods

inspect(): string
toConfig(): GraphQLScalarTypeConfig<any, any> & { serialize: GraphQLScalarSerializer<any>; parseValue: GraphQLScalarValueParser<any>; parseLiteral: GraphQLScalarLiteralParser<any>; extensions: Maybe<Readonly<Record<string, any>>>; extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>; }
toJSON(): string
toString(): string