graphql-custom-directives v0.2.16: a collection of reusable GraphQL schema directives for transforming field values (date formatting, number/currency, string casing, trimming, templating, phone formatting) at query execution time. Built on Moment, Lodash, and Numeral-js. Compatible with graphql-js and Apollo Server. Current stable version is 0.2.16 (last updated 2019); release cadence is low – no updates since 2019. Key differentiator: provides ready-made directive implementations without needing to write custom directive classes. Contrast with graphql-custom-directive (a library for authoring new directives).
npm install graphql-custom-directivesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates setting up a schema with a custom uppercase directive and executing a query.
Consider migrating to graphql-tools v7+ or using @graphql-tools/schema with mapSchema and MapperKind.
Upgrade graphql to v14.x or v15.x, or use a different directive library such as @graphql-tools/schema.
Always call applySchemaCustomDirectives immediately after schema creation and before executing queries.
Consider using a lighter date library or custom directives.
Add GraphQLUpperCaseDirective (or the appropriate directive) to the directives array when constructing the GraphQLSchema.
Ensure the schema object is fully constructed before calling applySchemaCustomDirectives(schema).
Use @date(format: "YYYY-MM-DD") syntax in your schema SDL or field definition.