Skip to main content

Simple resolvers (performance)

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:

generator typegraphql {
provider = "typegraphql-prisma"
simpleResolvers = true
}

It will generate then all the output type and model type classes with simpleResolvers: true option of @ObjectType decorator, which can improve performance of underlying field resolvers, e.g.:

@TypeGraphQL.ObjectType({
description: undefined,
simpleResolvers: true,
})
export class BatchPayload {
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
nullable: false,
description: undefined,
})
count!: number;
}