Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: GraphQL error: Int cannot represent non 32-bit signed integer value: 1672250526945 #59

Open
webuniverseio opened this issue Dec 28, 2022 · 1 comment

Comments

@webuniverseio
Copy link

Running following mutation from https://frontendmasters.com/courses/client-graphql-react/querying-mutations-demo/
image
results in following error Error: GraphQL error: Int cannot represent non 32-bit signed integer value: 1672250526945
image

It looks like graphql server implementation is using Int type instead of Date https://stackoverflow.com/questions/44982279/graphql-large-integer-error-int-cannot-represent-non-32-bit-signed-integer-valu

@webuniverseio
Copy link
Author

For a hacky fix so I can proceed for now I updated following line in pet.js, but I'm sure we can use a better format for dates

const newPet = {id: nanoid(), createdAt: Math.round(Date.now() / 10000), ...pet}

⚠️ use at your own risk ;) ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant