GraphQL scalar types for integers with arbitrary precision and bounds, including 8/16/32/64-bit signed and unsigned integers. Version 1.0.2 is the latest stable release. The library uses JavaScript's BigInt for 64-bit integers (GraphQLKind STRING) and supports custom range validation via factory functions. Key differentiator: it provides precise integer types beyond JavaScript's 53-bit number precision, unlike basic GraphQLInt. Requires Node >=10.4.0 and graphql >=0.13.0.
npm install graphql-type-intsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a GraphQL schema with GraphQLInt8 and GraphQLBigInt64 scalars, demonstrating usage with graphql-tools.
Ensure your client code can handle string-encoded integers for the 64-bit scalar types.
Replace import { makeExecutableSchema } from 'graphql-tools' with import { makeExecutableSchema } from '@graphql-tools/schema'.Ensure each custom type's name is unique within your schema.
Use createGraphQLBigIntType or createGraphQLStringIntType for values beyond that range.
Always convert input to bigint if passing number; use BigInt() or parseInt().
Include GraphQLInt8 in the resolvers object as shown in quickstart example.
Ensure input is integer type (not quoted) in GraphQL query: { value(v: 100) }.Convert numbers to BigInt: BigInt(5) + someBigInt.
Use unique names for each custom type.