{"_id":"graphql-bigint","_rev":"399105","name":"graphql-bigint","description":"A 53-bit wide implementation of integers for GraphQL","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"acarl005","email":"acarl005@g.ucla.edu"}],"time":{"modified":"2021-08-04T04:24:36.000Z","created":"2017-07-27T00:38:09.276Z","1.0.0":"2017-07-27T00:38:09.276Z"},"users":{},"author":{"name":"acarl005","email":"acarl005@g.ucla.edu"},"repository":{"type":"git","url":"git+https://github.com/stems/graphql-bigint.git"},"versions":{"1.0.0":{"name":"graphql-bigint","version":"1.0.0","description":"A 53-bit wide implementation of integers for GraphQL","main":"index.js","peerDependencies":{"graphql":"*"},"devDependencies":{"chai":"^4.1.0","graphql":"^0.10.5","nyc":"^11.0.3"},"scripts":{"test":"nyc node ./test.js"},"repository":{"type":"git","url":"git+https://github.com/stems/graphql-bigint.git"},"keywords":["graphql","int","bigint","long","number"],"author":{"name":"acarl005","email":"acarl005@g.ucla.edu"},"license":"MIT","bugs":{"url":"https://github.com/stems/graphql-bigint/issues"},"homepage":"https://github.com/stems/graphql-bigint#readme","gitHead":"4d89a0f5f32ad4f0825c91d607b8b61f85cd9bbf","_id":"graphql-bigint@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"acarl005","email":"acarl005@g.ucla.edu"},"dist":{"shasum":"b2909be9c9970a9a7697273c27d0ea47a146a19c","size":3085,"noattachment":false,"key":"/graphql-bigint/-/graphql-bigint-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-bigint/download/graphql-bigint-1.0.0.tgz"},"maintainers":[{"name":"acarl005","email":"acarl005@g.ucla.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-bigint-1.0.0.tgz_1501115889183_0.49282784876413643"},"directories":{},"publish_time":1501115889276,"_hasShrinkwrap":false,"_cnpm_publish_time":1501115889276}},"readme":"graphql-bigint\n=============\n\nA wider integer type for [graphql-js](https://github.com/graphql/graphql-js) than the default 32-bit `GraphQLInt`. This implementation gives you 53-bit integers.\n\n## The problem\n\nThe GraphQL spec limits its `Int` type to 32-bits. Maybe you've seen this error before:\n\n```\nGraphQLError: Argument \"num\" has invalid value 9007199254740990.\n              Expected type \"Int\", found 9007199254740990.\n```\n\nWhy? 64-bits would be too large for JavaScript's 53-bit limit. According to Lee Byron, a 52-bit integer spec would have been \"too weird\" [see this issue](https://github.com/graphql/graphql-js/issues/292).\n\n## Usage\n\n```shell\n$ npm install graphql-bigint\n```\n\nUse it the same as any other scalar type, either input or output.\n\n```js\nconst BigInt = require('graphql-bigint')\n\nconst SomeType = new GraphQLObjectType({\n  name: 'SomeType',\n  fields: {\n    numberField: {\n      type: BigInt,\n      // this would throw an error with the GraphQLInt\n      resolve: () => Number.MAX_SAFE_INTEGER \n    }\n  }\n})\n```\n\n","_attachments":{},"homepage":"https://github.com/stems/graphql-bigint#readme","bugs":{"url":"https://github.com/stems/graphql-bigint/issues"},"license":"MIT"}