A GraphQL custom scalar type for Date values. Version 1.0.3 is the current stable release. The package provides a simple GraphQLDate scalar that serializes, parses, and validates date strings. It is widely used in GraphQL schemas to handle dates, but is not actively maintained. Alternatives include using graphql-iso-date or the built-in graphql@14+ Date scalar.
npm install graphql-dateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a GraphQL schema with a date field and querying it.
Switch to graphql-iso-date or use GraphQLDate from graphql@14+.
Use CommonJS require() or ensure your build pipeline handles CJS to ESM conversion.
Always format dates as ISO 8601 strings before returning in resolvers.
Use a library like graphql-iso-date which supports timezone-aware types.
Install graphql: npm install graphql
Use require() instead: const GraphQLDate = require('graphql-date');Ensure you return a valid ISO string or a Date object. For example: resolve: () => new Date().toISOString()