A comprehensive library of custom GraphQL scalar types for precise type-safe schemas. Current stable version is 1.25.0, with regular releases. It provides over 40 scalars (DateTime, JSON, UUID, Email, etc.) not included in base GraphQL, supporting GraphQL v0.8 to v16. Maintained by The Guild, it ships TypeScript definitions and is ESM- and CJS-compatible. Key differentiators: extensive scalar collection, active maintenance, broad GraphQL version support, and detailed documentation on graphql-scalars.dev.
npm install graphql-scalarsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using DateTime, EmailAddress, and JSON scalars with @graphql-tools/schema.
Replace 'GraphQLTimestamp' with 'Timestamp' in imports.
Update imports from 'GraphQL*' to the capitalized scalar name (e.g. 'import { UUID } from ...').Use named imports like `import { DateTime } from 'graphql-scalars'` instead of `import scalars from 'graphql-scalars'`.Import from 'graphql-scalars/esm' instead of 'graphql-scalars'.
Review the validation logic on the documentation site for each scalar.
Upgrade GraphQL peer dependency to ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0.
Run `npm install graphql-scalars` and ensure you are importing correctly. For ESM projects, use `import { ... } from 'graphql-scalars/esm'`.Use named import: `import { DateTime } from 'graphql-scalars'` instead of `import scalars from 'graphql-scalars'`.Change import to ESM: `import { DateTime } from 'graphql-scalars/esm'` or use dynamic import.Ensure the resolver is set as `DateTime: DateTime` where DateTime is the imported object.