kriasoft/graphql-starter-kit

big int

Mario-35 opened this issue · 1 comments

Hello and great job

add bigint in list in file : update-types.ts
const type = ["integer", "numeric", "decimal"].includes(x.type)

because it put it like a string

It is a safe default. It's possible to cast to to BigInt instead. For this to work, you would also need to add a custom type parser in pg Postgres client:

import { types } from "pg";

types.setTypeParser(20, BigInt); // Type Id 20 = BIGINT | BIGSERIAL

or, if you want an integer, it would be:

types.setTypeParser(20, x => parseInt(x));