Search code examples
typescriptgraphqlapollonexus-prisma

Nexus GraphQl does not generate types when schema.prisma is changed


So, the core of the problem is described in title, but When I commiting changes to schema.prisma my autogenerated export types in ./generated/nexus.ts don't refresh. I also don't see changes in apollo playground on my localhost:4000 I tried to migrate my schema and 'npx generate path to my schema' but they didn't work neither. Without this I can't proceed with writing mutations and queries because TS can't see new types.


Solution

  • Ok, so I managed to fix it, if any other faced with this problem so the solution can be found here https://github.com/prisma/prisma-examples/blob/latest/typescript/graphql-auth/README.md The main issue was that you have to run your server after migration with db and after changes to schema.ts.