Skip to content

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Oct 24, 2019
1 parent dfbfdcc commit 10ed7ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/resolvers/BigInt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { Kind } from 'graphql/language/kinds';

const coerceBigInt = (value: any) => {
if (typeof BigInt === 'undefined') {
const number = value.toString().replace('n', '');
const numberStr = value.toString().replace('n', '');
const number = Number(numberStr);
if (!Number.isInteger(number)) {
throw new Error(`${value} is not an integer!`);
}
Expand Down

0 comments on commit 10ed7ca

Please sign in to comment.