A GraphQL scalar type that extends 52-bit signed integer support for GraphQL.js. Current version 0.1.1, low release cadence. Enables serialization and parsing of integers beyond JavaScript's safe integer range (up to 52 bits). Compared to other GraphQL integer types (e.g., BigInt), this provides a lightweight solution for 52-bit integers without external dependencies. Peer dependency on GraphQL 0.9-0.13. Not actively maintained, but functional for legacy projects.
npm install graphql-type-longNo 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 the GraphQLLong scalar type with a query and a mutation argument.
Use a more modern package like graphql-bigint or implement custom scalar type for GraphQL v15+.
Use const GraphQLLong = require('graphql-type-long').defaultEnsure all input/output values are within the 52-bit signed integer range. For larger values, use BigInt or a custom scalar.
For precise handling of 52-bit integers, consider using strings if JSON transport is required.
Use const GraphQLLong = require('graphql-type-long').defaultEnsure you import GraphQLLong correctly: import GraphQLLong from 'graphql-type-long'
Add GraphQLLong to your schema configuration as shown in the quickstart code.
Ensure input is a 52-bit integer within range, provided as a plain number without scientific notation.