Stefan N
12/03/2020, 7:51 AMnode_modules/@types/typegen-nexus-plugin-prisma/
automatically when running the server in dev mode. But I need it to generate these types as a build step in CI/CD (otherwise next build fails as well). I do manage to generate the schema.graphql
and nexus.ts
running reflection like this npx ts-node -T ./graphql/schema/index.ts
and using the flag shouldExitAfterGenerateArtifacts
. But during this step, the nexus-plugin-prisma files do not seem to be generated. Here my code generating the schema: https://github.com/teachen-ch/voty/blob/d525c36a0a7cff85816804e86f3b854cac480d69/graphql/makeschema.ts#L12Ryan
12/03/2020, 7:58 AMoutputs
property as follows:
export const schema = makeSchema({
types: [allTypes],
plugins: [nexusPrisma],
outputs: {
typegen: join(__dirname, 'generated', 'index.d.ts'),
schema: join(__dirname, 'generated', 'schema.graphql'),
},
typegenAutoConfig: {
sources: [
{
source: '@prisma/client',
alias: 'prisma',
},
{
source: join(__dirname, 'types.ts'),
alias: 'ctx',
},
],
contextType: 'ctx.Context',
},
})
Ryan
12/03/2020, 8:00 AMStefan N
12/03/2020, 8:08 AM