📄️ 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
Hiding field in output types
📄️ 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:
📄️ 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 an array of values
📄️ Applying decorators
Additional decorators for Prisma schema resolvers
📄️ Simple inputs
In version 2.6.0, Prisma released atomicNumberOperations preview feature that allows you to update scalar fields without checking the current value, e.g. increment or decrement a number value.
📄️ 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.
📄️ 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:
📄️ Emit ID type
By default, TypeGraphQL Prisma generator emits GraphQL types for fields with the underlying data types, like Int or String scalars.
📄️ Custom plural form
In some cases, the noun used as the model name might not have a proper plural form. For example, the word "fish" is not pluralized to "fishes". In such cases, you can override the plural form by adding a plural argument to the @@TypeGraphQL.type comment attribute, e.g.:
📄️ 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.
📄️ Redundant types
By default, typegraphql-prisma tries to minimize the generated LOC by omitting the redundant types info.
📄️ Overriding object decorator
By default, typegraphql-prisma generator emits TypeGraphQL classes for models with all the decorators applied.
📄️ Emit isAbstract
By default, TypeGraphQL Prisma generator aims to work with newest release of TypeGraphQL.