exogee-technology / graphweaver

Turn multiple data sources into a single GraphQL API
https://graphweaver.com
Other
491 stars 18 forks source link

Using `bigint` primary keys results in a serialisation issue at runtime #1355

Open thekevinbrown opened 8 hours ago

thekevinbrown commented 8 hours ago

Describe the bug When you use bigint primary keys everything works until we pass the data over to the graphql reference implementation:

"message":"ID cannot represent value: 1","stack":"GraphQLError: ID cannot represent value: 1\n    at GraphQLScalarType.serialize ([project directory]/node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/type/scalars.js:301:11)

To Reproduce

Create a table as follows:

CREATE TABLE test (
    id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    note text
);

Then populate some data in the table. Query the values from the table.

Expected behavior Expected functional query response.

Actual behavior Error

Additional context It looks like they're not going to coerce these values for us: https://github.com/graphql/graphql-js/issues/3913