import { GraphQLScalarType } from "https://dotland.deno.dev/x/graphql_deno@v15.0.0/lib/index.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
astNode: Maybe<ScalarTypeDefinitionNode>
extensionASTNodes: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>
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