loading...

re: Complete Introduction to Fullstack, Type-Safe GraphQL (feat. Next.js, Nexus, Prisma) VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Yes, that's exactly what I am talking about, you now have to write import statements for all schema related files in graphql/schema.ts. If you do...

I'm not sure why it would continue to work with Nexus dev server's /graphql route, but my guess is that it's due to some caching not being invalidated by Nexus (probably a bug, I'll try to dig into it). The correct behavior should be it fails as well. :)

Edit: Normally, Nexus actually scans the entire project for import {schema} from 'nexus', if an entry point is not specified.

I think the problem you are encountering is because somehow Nexus imported the external schema after the Nexus app has assembled. Actually, when working with Next.js, it's not recommended to have multiple files that import the same part (like use, schema) from Nexus.

code of conduct - report abuse