Scalars

Scalars your schema is missing

GraphQL ships with five scalars. GraphQL Scalars adds more than eighty precise, validated types for dates, identifiers, formats, and units, with mocks and TypeScript definitions. Part of the Hive ecosystem by The Guild.

Precise types, less validation code

Add a scalar in two lines

Import the type definition and its resolver, add both to the schema, and use the scalar like any built-in one.

Quick start
import { makeExecutableSchema } from '@graphql-tools/schema';
import { DateTimeResolver, DateTimeTypeDefinition, EmailAddressResolver } from 'graphql-scalars';

const schema = makeExecutableSchema({
  typeDefs: [
    DateTimeTypeDefinition,
    'scalar EmailAddress',
    `type User { email: EmailAddress!, createdAt: DateTime! }`,
  ],
  resolvers: {
    DateTime: DateTimeResolver,
    EmailAddress: EmailAddressResolver,
  },
});

Learn more

Discover the complete ecosystem of tools and libraries

Complete GraphQL Federation Stack

Our libraries to support all your GraphQL needs

Explore the Ecosystem