Skip to content

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

@thekevinbrown

Description

@thekevinbrown

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/[email protected]/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: graphql/graphql-js#3913

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions