fullstack-graphql icon indicating copy to clipboard operation
fullstack-graphql copied to clipboard

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

Open webuniverseio opened this issue 1 year ago • 1 comments

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 avatar Dec 28 '22 18:12 webuniverseio

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 ;) ⚠️

webuniverseio avatar Dec 28 '22 18:12 webuniverseio