Can i just use types from `"node_modules/.prisma/c...
# orm-help
j
Can i just use types from
"node_modules/.prisma/client"
instead of using
typegraphql-prisma
and generating types which emits the generated typegraphql classes to
"node_modules/@generated/typegraphql-prisma"
? PS: i found that
"node_module/.prisma/client"
contains the types. Using
typegraphql-prisma
seems redundant. Isn't it? Basically can i do
import { User } from ".prisma/client"
, INSTEAD OF ``import { User } from "@generated/type-graphql/models/User"``. Is there any danger zone while doing so?
r
I don’t think there should be any issue.
Using 
typegraphql-prisma
 seems redundant. Isn’t it?
This will be needed if you want to autogenerate your resolvers. Prisma will not do that for you.
j
@Ryan i missed that. So typegraphql-prisma can generate resolver too. Is it reliable? or one should code the resolver manually? I'm finding myself pretty much blunt here
r
Yeah it is reliable and will generate all CRUD resolvers based on your
schema.prisma
.
j
@Ryan I wonder why then people do create resolvers manually? What drives them to create resolvers manually? Those who create resolvers manually, do they also create types manually or take help of tools like
typegraphql-prisma
?
r
If you require some custom logic outside of basic CRUD then you need to create the resolvers yourself, otherwise it’s better to use an autogenerated option.