Skip to content

Releases: MichalLytek/typegraphql-prisma

0.23.0

23 Nov 13:29
Compare
Choose a tag to compare
0.23.0 Pre-release
Pre-release

Changelog

  1. This release enables support for the new filteredRelationCount preview 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
            }
          }
        ]
      }
    }
  2. Introducing filteredRelationCount support required some changes around transformFields in 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

09 Nov 14:07
Compare
Choose a tag to compare
0.22.2 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.6.0 🚀
    Because of some changes in DMMF, this time it contains two new operations: findUniqueOrThrow and findFirstOrThrow.
    By default, findUniqueOrThrow will be mapped to getXYZ query:

    @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)),
    		});
    	}
    }
  2. filteredRelationCount support is also work in progress. You can expect it to work in next release 👀

0.22.1

31 Oct 15:38
Compare
Choose a tag to compare
0.22.1 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.5.0 🚀
    It also supports extendedWhereUnique preview feature.

  2. filteredRelationCount support is also work in progress. Stay tuned! 📻

0.22.0

17 Oct 11:29
Compare
Choose a tag to compare
0.22.0 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.4.0 🚀

  2. Recently introduced feature useSimpleUpdateInputs has been enhanced and improved. Now it's named useSimpleInputs and affects also create inputs, 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

26 Sep 13:33
Compare
Choose a tag to compare
0.21.5 Pre-release
Pre-release

Changelog

This release contains two new features! 🚀

  1. 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 = true generator option, instead of generating nested inputs with IntFieldUpdateOperationsInput or StringFieldUpdateOperationsInput as 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;
    }

    More info about this feature in the docs.

  2. A new parameter called plural for the @@TypeGraphQL.type docs 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 of findManyXYZ or findUniqueXYZ:

    @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

31 Aug 12:14
Compare
Choose a tag to compare
0.21.4 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.3.0 🚀

  2. Support for new Prisma Preview Features: fieldReference and filteredRelationCount, will be added in a near future. Stay tuned! 📻

0.21.3

10 Aug 13:05
Compare
Choose a tag to compare
0.21.3 Pre-release
Pre-release

Changelog

  1. The supported Prisma version has been upgraded v4.2.0 💪
    There's no breaking changes expected, all should work flawlessly.

0.21.2

27 Jul 14:25
Compare
Choose a tag to compare
0.21.2 Pre-release
Pre-release

Changelog

  1. This release fixes a bug #270 when @prisma/client import was used even if the customPrismaImportPath generator option was provided.

0.21.1

21 Jul 11:44
Compare
Choose a tag to compare
0.21.1 Pre-release
Pre-release

Changelog

  1. The supported Prisma version has been upgraded v4.1.0 💪
    There's no breaking changes expected, all should work flawlessly.

  2. If you use the new orderByNulls preview feature, you can expect changes in XYZWithAggregationInput and a new SortOrderInput type.

0.21.0

09 Jul 12:04
Compare
Choose a tag to compare
0.21.0 Pre-release
Pre-release

Changelog

  1. 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 using typegraphql-prisma.

  2. The name of the Prisma actions have been unified. Now all the singular actions (createXYZ, updateXYZ, upsertXYZ and deleteXYZ) have the One suffix (deleteOneUser, createOnePost), just like the findMany or updateMany. This mean that the exposed GraphQL queries and mutation will have the name changed too, not only the resolver or action classes names.

  3. 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.

  4. The FooUpdateManyWithoutBarInput inputs has been renamed to FooUpdateManyWithoutBarNestedInput.