ποΈ 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.