Nexus-plugin-prisma: Wrong place for generated types definition

Created on 1 Oct 2020  路  5Comments  路  Source: graphql-nexus/nexus-plugin-prisma

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',
  },
})

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mohe2015 picture mohe2015  路  3Comments

jamesopti picture jamesopti  路  4Comments

mihazs picture mihazs  路  4Comments

ndom91 picture ndom91  路  4Comments

antonbramsen picture antonbramsen  路  4Comments