ScalarTypeComposer
ScalarTypeComposer
is a class which helps to create and modify GraphQLScalarType
.
Static methods
static create()
Create ScalarTypeComposer
with adding it by name to the SchemaComposer
. This type became avaliable in SDL by its name.
static create(
opts: TypeAsString | GraphQLScalarTypeConfig | GraphQLScalarType
): ScalarTypeComposer
static createTemp()
Create ScalarTypeComposer
without adding it to the SchemaComposer
. This method may be usefull in plugins, when you need to create type temporary.
static createTemp(
opts: TypeAsString | GraphQLScalarTypeConfig | GraphQLScalarType
): ScalarTypeComposer
Properties
schemaComposer
Current SchemaComposer
instance which is used for storing types created by ScalarTypeComposer
.
SomeSTC.schemaComposer: SchemaComposer;
Serialize methods
setSerialize()
setSerialize(fn: GraphQLScalarSerializer<any>): void;
getSerialize()
getSerialize(): GraphQLScalarSerializer<any>;
setParseValue()
setParseValue(fn: ?GraphQLScalarValueParser<any>): void;
getParseValue()
getParseValue(): GraphQLScalarValueParser<any>;
setParseLiteral()
setParseLiteral(fn: ?GraphQLScalarLiteralParser<any>): void;
getParseLiteral()
getParseLiteral(): GraphQLScalarLiteralParser<any>;
Type methods
getType()
getType(): GraphQLScalarType;
getTypePlural()
getTypePlural(): GraphQLList<GraphQLScalarType>;
getTypeNonNull()
getTypeNonNull(): GraphQLNonNull<GraphQLScalarType>;
getTypeName()
getTypeName(): string;
setTypeName()
setTypeName(
name: string
): ScalarTypeComposer;
getDescription()
getDescription(): string;
setDescription()
setDescription(
description: string
): ScalarTypeComposer;
clone()
Create a new Scalar type with provided name.
clone(
newTypeName: string
): ScalarTypeComposer;
Internal type definitions
Flowtype definitions which are used in this class.
ScalarTypeComposerDefinition
type ScalarTypeComposerDefinition =
| TypeAsString
| GraphQLScalarTypeConfig
| GraphQLScalarType;