Collection of custom GraphQL scalar types including Email, URL, DateTime, LimitedString, Password, and UUID. Current stable version is 1.7.0. The package has a low release cadence (last release in 2022) and supports a wide range of GraphQL versions (0.6 to 16). It provides ready-to-use types for common domain-specific validations, with type definitions included. Alternatives like graphql-type-json or graphql-scalars offer broader collections, but this package focuses on essential types with minimal configuration.
npm install graphql-custom-typesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define a GraphQL schema using custom scalar types Email, URL, and UUID, and attach them to resolvers.
Switch to graphql-scalars for DateTime type.
Use 'new' keyword: const LimitedString = new GraphQLLimitedString(1, 100);
Pin graphql to v15.x or verify compatibility.
Use import { GraphQLEmail } from 'graphql-custom-types';Run npm install graphql graphql-custom-types
Install graphql v14 or v15: npm install graphql@15
Use 'new GraphQLLimitedString(...)'