Releases: MichalLytek/typegraphql-prisma
Release list
0.23.0
Changelog
-
This release enables support for the new
filteredRelationCountpreview feature 🚀It allows using conditions while getting relations count. Thanks to this, you can now use enhanced queries, e.g.:
query UsersWithAdvertKindPostsCount { users { id name _count { advertPosts: posts(where: { kind: { equals: ADVERT } }) } } }
{ "data": { "users": [ { "id": 1, "name": "Test", "_count": { "advertPosts": 5 } } ] } } -
Introducing
filteredRelationCountsupport required some changes aroundtransformFieldsin generated resolvers, so be aware of the minor changes in the resolvers body. They should not affect the way normal queries are handled, even with the feature flag turned off.
0.22.2
Changelog
-
Supported Prisma version has been bumped to v4.6.0 🚀
Because of some changes in DMMF, this time it contains two new operations:findUniqueOrThrowandfindFirstOrThrow.
By default,findUniqueOrThrowwill be mapped togetXYZquery:@TypeGraphQL.Resolver(_of => Category) export class FindUniqueCategoryOrThrowResolver { @TypeGraphQL.Query(_returns => Category, { nullable: true }) async getCategory(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueCategoryOrThrowArgs): Promise<Category | null> { const { _count } = transformFields( graphqlFields(info as any) ); return getPrismaFromContext(ctx).category.findUniqueOrThrow({ ...args, ...(_count && transformCountFieldIntoSelectRelationsCount(_count)), }); } }
-
filteredRelationCountsupport is also work in progress. You can expect it to work in next release 👀
0.22.1
Changelog
-
Supported Prisma version has been bumped to v4.5.0 🚀
It also supportsextendedWhereUniquepreview feature. -
filteredRelationCountsupport is also work in progress. Stay tuned! 📻
0.22.0
Changelog
-
Supported Prisma version has been bumped to v4.4.0 🚀
-
Recently introduced feature
useSimpleUpdateInputshas been enhanced and improved. Now it's nameduseSimpleInputsand affects alsocreateinputs, which fixes inconvenience while working with MongoDB and nested documents 💪More info about this feature in the docs:
https://prisma.typegraphql.com/docs/advanced/simple-inputs
0.21.5
Changelog
This release contains two new features! 🚀
-
A long awaited generator option to emit flat input fields (without 'set' and other operations) described in #221 has been finally implemented! 🎉
By using
useSimpleUpdateInputs = truegenerator option, instead of generating nested inputs withIntFieldUpdateOperationsInputorStringFieldUpdateOperationsInputas a field type, it will emit much simpler version of inputs for update operations with just scalar fields:@TypeGraphQL.InputType("CategoryUpdateInput", { isAbstract: true, }) export class CategoryUpdateInput { - @TypeGraphQL.Field(_type => StringFieldUpdateOperationsInput, { + @TypeGraphQL.Field(_type => String, { nullable: true, }) - name?: StringFieldUpdateOperationsInput | undefined; + name?: string | undefined; - @TypeGraphQL.Field(_type => StringFieldUpdateOperationsInput, { + @TypeGraphQL.Field(_type => String, { nullable: true, }) - slug?: StringFieldUpdateOperationsInput | undefined; + slug?: string | undefined; - @TypeGraphQL.Field(_type => IntFieldUpdateOperationsInput, { + @TypeGraphQL.Field(_type => TypeGraphQL.Int, { nullable: true, }) - number?: IntFieldUpdateOperationsInput | undefined; + number?: number | undefined; } -
A new parameter called
pluralfor the@@TypeGraphQL.typedocs attribute, e.g./// @@TypeGraphQL.type(plural: "equipments").It allows overriding the default plural detection mechanism, so that you can provide your custom word for models with names that do not have plural form, e.g.
Equipment. With this option, the generator will emit proper names for queries that normally would have a form offindManyXYZorfindUniqueXYZ:@TypeGraphQL.Resolver(_of => Equipment) export class FindManyEquipmentResolver { @TypeGraphQL.Query(_returns => [Equipment], { nullable: false }) - async findManyEquipment(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyEquipmentArgs): Promise<Equipment[]> { + async equipments(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyEquipmentArgs): Promise<Equipment[]> { const { _count } = transformFields( graphqlFields(info as any) ); return getPrismaFromContext(ctx).equipment.findMany({ ...args, ...(_count && transformCountFieldIntoSelectRelationsCount(_count)), }); } }
0.21.4
Changelog
-
Supported Prisma version has been bumped to
v4.3.0🚀 -
Support for new Prisma Preview Features:
fieldReferenceandfilteredRelationCount, will be added in a near future. Stay tuned! 📻
0.21.3
Changelog
- The supported Prisma version has been upgraded v4.2.0 💪
There's no breaking changes expected, all should work flawlessly.
0.21.2
Changelog
- This release fixes a bug #270 when
@prisma/clientimport was used even if thecustomPrismaImportPathgenerator option was provided.
0.21.1
Changelog
-
The supported Prisma version has been upgraded v4.1.0 💪
There's no breaking changes expected, all should work flawlessly. -
If you use the new
orderByNullspreview feature, you can expect changes inXYZWithAggregationInputand a newSortOrderInputtype.
0.21.0
Changelog
-
The supported Prisma version has been upgraded to the latest major release - v4.0.0 💪
New Prisma release contains a lot of changes in DMMF, so expect a few breaking changes in your projects usingtypegraphql-prisma. -
The name of the Prisma actions have been unified. Now all the singular actions (
createXYZ,updateXYZ,upsertXYZanddeleteXYZ) have theOnesuffix (deleteOneUser,createOnePost), just like thefindManyorupdateMany. This mean that the exposed GraphQL queries and mutation will have the name changed too, not only the resolver or action classes names. -
CRUD resolvers now do have all the methods ordered by method name in ascending order. This will prevent some ghost changes when DMMF order changes.
-
The
FooUpdateManyWithoutBarInputinputs has been renamed toFooUpdateManyWithoutBarNestedInput.