{"id":47810,"library":"graphql-bigint","title":"graphql-bigint","description":"Provides a 53-bit wide integer scalar for graphql-js, extending the default 32-bit GraphQLInt to cover JavaScript's safe integer range (Number.MAX_SAFE_INTEGER). Current stable version is 1.0.0. No recent updates; the library is simple and stable. Key differentiator: unlike alternatives like GraphQLInt, it accepts values up to 2^53-1, solving the common 'Invalid value' error for large integers.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/stems/graphql-bigint","tags":["javascript","graphql","int","bigint","long","number"],"install":[{"cmd":"npm install graphql-bigint","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-bigint","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-bigint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; library is a GraphQL scalar type used with graphql-js","package":"graphql","optional":false}],"imports":[{"note":"CommonJS requires the default export directly; named exports are not provided.","wrong":"const BigInt = require('graphql-bigint').default","symbol":"default","correct":"import BigInt from 'graphql-bigint'"},{"note":"The package exports a single default value, not a named export.","wrong":"const { BigInt } = require('graphql-bigint')","symbol":"default","correct":"const BigInt = require('graphql-bigint')"},{"note":"The scalar is custom-named as GraphQLBigInt in some contexts, but the package only exports a default.","wrong":"import { GraphQLBigInt } from 'graphql-bigint'","symbol":"GraphQLBigInt","correct":"import GraphQLBigInt from 'graphql-bigint'"}],"quickstart":{"code":"const { GraphQLObjectType, GraphQLSchema, GraphQLString } = require('graphql');\nconst BigInt = require('graphql-bigint');\n\nconst UserType = new GraphQLObjectType({\n  name: 'User',\n  fields: () => ({\n    id: { type: BigInt },\n    name: { type: GraphQLString }\n  })\n});\n\nconst schema = new GraphQLSchema({ query: UserType });\n\nconsole.log('Schema using BigInt created');","lang":"javascript","description":"Creates a GraphQL schema with a BigInt field to handle large integers."},"warnings":[{"fix":"Use a string-based BigInt scalar if you need arbitrary precision beyond 53 bits.","message":"The BigInt scalar accepts only integers up to Number.MAX_SAFE_INTEGER (2^53-1); values outside that range will cause precision loss.","severity":"gotcha","affected_versions":"all"},{"fix":"Coerce values with Math.floor() or similar before returning from resolvers.","message":"The scalar does not validate non-integer values (e.g., floats) – they will be accepted and truncated.","severity":"gotcha","affected_versions":"all"},{"fix":"Use dynamic import or a bundler that handles CommonJS.","message":"The package uses CommonJS only; no ESM exports are provided.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"search_vec":"'-1':58 '1.0.0':35 '2':56 '32':18 '53':6,57 'accept':52 'altern':48 'bigint':3,71 'bit':7,19 'common':61 'cover':22 'current':31 'default':17 'differenti':46 'error':64 'extend':15 'graphql':2,13,69 'graphql-bigint':1 'graphql-j':12 'graphqlint':20,50 'int':70 'integ':9,26,30,67 'invalid':62 'javascript':23,68 'js':14 'key':45 'larg':66 'librari':40 'like':49 'long':72 'number':73 'number.max':28 'provid':4 'rang':27 'recent':37 'safe':25,29 'scalar':10 'simpl':42 'solv':59 'stabl':32,44 'unlik':47 'updat':38 'valu':53,63 'version':33 'wide':8","created_at":"2026-06-07T16:53:25.693496+00:00","updated_at":"2026-06-07T16:53:25.693496+00:00","problems":[{"fix":"Use `const BigInt = require('graphql-bigint')` or `import BigInt from 'graphql-bigint'`.","cause":"Importing the default export incorrectly as a named export.","error":"TypeError: BigInt is not a constructor"},{"fix":"Use graphql-bigint's BigInt scalar for such values.","cause":"Using the default GraphQLInt scalar with a value larger than 32 bits.","error":"GraphQLError: Argument \"num\" has invalid value 9007199254740990. Expected type \"Int\", found 9007199254740990."},{"fix":"Run `npm install graphql-bigint`.","cause":"Package not installed or missing from dependencies.","error":"Cannot find module 'graphql-bigint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/stems/graphql-bigint#readme","github":"https://github.com/stems/graphql-bigint","docs":null,"changelog":null,"pypi":null,"npm":"graphql-bigint","openapi_spec":null,"status_page":null,"smithery":null,"categories":["api"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}