📄️ Exposing selected models
If you want to expose only CRUD Prisma actions for selected models, you can import crud resolver classes only for that models, instead of the all-in-one resolvers object.
📄️ Exposing selected actions
If you want to expose only certain Prisma actions, like findManyUser or createOneUser, you can import resolver classes only for them, instead of the whole model XYZCrudResolver.
📄️ Hiding model fields
Sometimes you may want to not expose some fields in GraphQL schema.
📄️ Adding model fields
If you want to add a field to the generated type like User, you have to create a proper @FieldResolver for that:
📄️ Custom operations
You can also add custom queries and mutations to the schema as always, using the generated PrismaClient:
📄️ Renaming model
You can also change the name of the model types exposed in GraphQL Schema.
📄️ Renaming field
You can also change the name of the model type fields exposed in GraphQL Schema.
📄️ Unchecked scalars input
GraphQL does not support input unions, hence it's not possible to support both normal inputs and unchecked scalars input at the same time like the Prisma does.
📄️ Applying decorators
Additional decorators for Prisma schema resolvers
📄️ Emit selected blocks
If you don't want to have generated all the CRUD API with all resolvers, arguments, inputs, outputs, models, etc., you can provide an emitOnly generator option, which accepts a string list of values
📄️ Simple resolvers
If you don't have any global middlewares and you want to tune the generated schema performance, you can turn on the simpleResolvers generator option:
📄️ Prisma import path
If you have a complex repository structure, e.g. with multiple Prisma clients generated, you can provide a custom Prisma import path as a generator option:
📄️ Prisma context key
By default, typegraphql-prisma looks in runtime for Prisma Client in the GraphQL context under the prisma key.