Hello there :)
When I use makeSchema, the [email protected] plugin generate by default typescript definition (@types/typegen-nexus-plugin-prisma/index.d.ts) inside my working directory instead of node_modules. The default path is supposed to be node_modules/@types/typegen-nexus-plugin-prisma/index.d.ts
Here is my schema.ts file (it is pretty standard)
import { makeSchema } from '@nexus/schema'
import { nexusSchemaPrisma } from 'nexus-plugin-prisma/schema'
import * as types from './types'
export const schema = makeSchema({
types,
plugins: [
nexusSchemaPrisma({
experimentalCRUD: true,
paginationStrategy: 'prisma',
}),
],
outputs: {
schema: true,
},
typegenAutoConfig: {
sources: [
{
source: '@prisma/client',
alias: 'client',
},
{
source: require.resolve('./context'),
alias: 'Context',
},
],
contextType: 'Context.Context',
},
})
there is a workaround as described in #873
The workaround doesn鈥檛 work.
same problem
nexusSchemaPrisma({
experimentalCRUD: true,
paginationStrategy: 'prisma',
outputs: {
typegen: path.join(process.cwd(), 'node_modules/@types/typegen-nexus-plugin-prisma/index.d.ts'),
},
}),
This workaround is work for me
Closed by #884