Closed felinto-dev closed 3 years ago
The idea would be to copy the way @prisma/client deals to avoid importing files generated through the plugin.
We can leave the files inside a .gitignore to avoid uploading a lot of unnecessary code and calling a module that solves this import.
Example
import {User} from '@ nestjs/prisma-graphql'
@Mutation (() => User)
async user () {}
or
import {UserGraphQL} from '@prisma/client'
@Mutation (() => UserGraphQL)
async user () {}
Rather than
import {User} from '../../../prisma/user/user.model'
@Mutation (() => User)
async user () {}
We don't plan to implement/provide such a package (and this won't change in the foreseeable future) as there's currently no bandwidth for that.
If you are interested in contributing to the community/ecosystem, consider creating it on your own and sharing it with others!
I'm submitting a...
When I'm using @prisma/client with @nestjs/graphql it's frustrating because I have to declare the same entity in two different places.
https://github.com/fivethree-team/nestjs-prisma-starter/blob/master/src/models/post.model.ts#L7 https://github.com/fivethree-team/nestjs-prisma-starter/blob/master/prisma/schema.prisma#L32
There are some solutions on the market that are willing to solve this problem, such as: https://www.npmjs.com/package/prisma-nestjs-graphql https://github.com/MichalLytek/typegraphql-prisma
However, it would be very interesting to have a package like:
@ nestjs / prisma-graphql
Or similar on purpose to resolve this deficiency. What do you think?