GraphQL response transformer for custom scalars. Version 2.2.0. Enables transforming scalar values in GraphQL responses from client-side requests (e.g., with graphql-request) using user-defined mapper functions. Requires graphql >= 15 and a local schema/operations file for type resolution. Unlike server-side scalar handling, this library works on the client after receiving the response. Ships TypeScript types. Actively maintained with regular releases.
npm install graphql-transform-scalarsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to instantiate TransformCustomScalars with custom scalar definitions, schema, and operations for client-side scalar transformation.
Provide both 'schema' and 'operations' options to TransformCustomScalars constructor.
Use parseValue only. For full GraphQLScalarType, use separate import from graphql.
Ensure you are using graphql-codegen with the appropriate plugin (e.g., graphql-request).
Use GraphQLScalarType definitions for server-side handling.
Pass a single object with { transformDefinitions, schema, operations }.Pass a valid GraphQL schema string via the 'schema' option.
Run 'npm install graphql' or 'yarn add graphql'.
Provide an array of objects with 'name' and 'parseValue' functions.