keystonejs / keystone

The superpowered headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
9.19k stars 1.16k forks source link

generated keystone schema and graphql-yoga-server are not being compatible #8601

Closed ebayasgalan closed 1 year ago

ebayasgalan commented 1 year ago

Problem: When deploying nextjs and keystone to Vercel, the production is not creating /api/graphql endpoint because graph-yoga config schema is not accepting keystone's generated schema.

Everything works as expected on development environment. The bug happens only on deployment.

The error on the console:

Screenshot 2023-06-01 at 8 34 25 PM

I'm using: nextjs v13.4.4 keystone6 node v18.16.0

ebayasgalan commented 1 year ago

The code on github: nextjs-app

ebayasgalan commented 1 year ago
Screenshot 2023-06-04 at 8 53 53 AM

^This is the error that keeps on creeping up after a few successful fetch. I've tried "npm ls graphql" and made sure there's only one graphql package installed in node_modules. Also added "resolutions" into package.json. But the issue persists, is there anyone else having this issue? I've tried a simple schema for graphql-yoga-server and found out it works fine. It seems like the bug is stemming from keystone's graphql schema.

To replicate the error: Create a route handler using next.js pages or app dir - /api/graphql. Refresh the page a few times and the bug will come out.