diff --git a/src/type/scalars.ts b/src/type/scalars.ts index d2c9c9bee2..81d89cd8e9 100644 --- a/src/type/scalars.ts +++ b/src/type/scalars.ts @@ -222,8 +222,8 @@ export const GraphQLID = new GraphQLScalarType({ if (typeof coercedValue === 'string') { return coercedValue; } - if (Number.isInteger(coercedValue)) { - return String(coercedValue); + if (Number.isInteger(coercedValue) || typeof coercedValue == "bigint") { + return String(coercedValue); } throw new GraphQLError( `ID cannot represent value: ${inspect(outputValue)}`,