Skip to content

Releases: MichalLytek/typegraphql-prisma

0.24.4

22 Mar 14:39
Compare
Choose a tag to compare
0.24.4 Pre-release
Pre-release

Changelog

  1. It is now possible to configure generator to always omit some field in input or output types for all models (#356).

    Some fields like createdAt or updatedAt are being frequently omitted from input types, which is cumbersome to manually maintain in schema.prisma file for all the models. Hence there are now two new generator options that allows to omit by default some fields - omitInputFieldsByDefault and omitOutputFieldsByDefault, e.g.:

    generator typegraphql {
      provider                  = "typegraphql-prisma"
      omitInputFieldsByDefault  = "createdAt,updatedAt"
      omitOutputFieldsByDefault = "password"
    }

    You can find more info about this feature in the docs:
    https://prisma.typegraphql.com/docs/advanced/hiding-field#omit-fields-by-default

0.24.3

15 Mar 13:55
Compare
Choose a tag to compare
0.24.3 Pre-release
Pre-release

Changelog

  1. Due to a bug in a Prisma Client (prisma/prisma#18326), there was an issue with getting relations during findMany queries (#367).
    This has been fixed and now the queries should work without any issues 💪

  2. You might expect some changes in generated resolvers because of patching small issue with redundant type infos - using _returns which now is _type: @TypeGraphQL.Args(_type => AggregateCategoryArgs) args: AggregateCategoryArgs

0.24.2

01 Mar 13:07
Compare
Choose a tag to compare
0.24.2 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.11.0 💪
    Because of small changes in DMMF, you may expect changes in the order of fields in generated code:

    @TypeGraphQL.InputType("CommentWhereInput", {
      isAbstract: true
    })
    export class CommentWhereInput {
      // ...
    
    - @TypeGraphQL.Field(_type => PostRelationFilter, {
    -   nullable: true
    - })
    - post?: PostRelationFilter | undefined;
    
      @TypeGraphQL.Field(_type => StringFilter, {
        nullable: true
      })
      comment?: StringFilter | undefined;
    
    + @TypeGraphQL.Field(_type => PostRelationFilter, {
    +  nullable: true
    + })
    + post?: PostRelationFilter | undefined;
    }

    However, it won't affect any schema capabilities, so you can safely upgrade 👌

0.24.1

27 Feb 16:28
Compare
Choose a tag to compare
0.24.1 Pre-release
Pre-release

Changelog

  1. This release is a hotfix for a bug introduced in v0.24.0 and reported in #361.
    Now the _all property should be optional for both resolvers and types/models 🙌

0.24.0

22 Feb 17:54
Compare
Choose a tag to compare
0.24.0 Pre-release
Pre-release

Changelog

  1. Support for overriding _all property decorators in enhance maps has been added 🚀

    Now you can use the function variant to override decorators declared for all resolver methods:

    applyResolversEnhanceMap({
      Story: {
        _all: [Authorized(Role.ADMIN, Role.MEMBER)],
        createStory: () => [Authorized(Role.SUPER_ADMIN)], // require higher role
        story: () => [], // make it public by returning no `@Authorized` decorators
      },
    });

    And even combine the "all" decorators with the ones for selected method:

    applyResolversEnhanceMap({
      Client: {
        _all: [Extensions({ logMessage: "Fun zone" }), Authorized()],
        deleteClient:
          // ignore log message extension
          ([_logExtension, auth]) => [
            // provide own message
            Extensions({ logMessage: "Danger zone" }),
            // passthrough the "all" auth decorator
            auth,
          ],
      },
    });

    This feature works for all enhance maps - resolvers, relation resolvers, models, outputs and input types, e.g.:

    applyModelsEnhanceMap({
      User: {
        fields: {
          // all fields are protected against unauthorized access
          _all: [Authorized()],
          // this field has additional decorators to apply
          password: [
            Extensions({ logMessage: "Danger zone", logLevel: LogLevel.WARN }),
          ],
          // this field is public, no `@Authorized` decorator returned
          id: allDecorators => [],
        },
      },
    });

0.23.5

08 Feb 13:14
Compare
Choose a tag to compare
0.23.5 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.10.0 💪
    No changes in DMMF detected, so no generated code should be affected.

  2. Support for overriding object type decorator (#345) has been added 🚀
    More info in docs: https://prisma.typegraphql.com/docs/advanced/overriding-object-decorator

0.23.4

01 Feb 14:43
Compare
Choose a tag to compare
0.23.4 Pre-release
Pre-release

Changelog

  1. Support for relations count in nested relation has been added (#354 ) 🎉
    Previously it was possible to run such queries as the below one, but it was returning null for _count:
    query GetPostsWithAuthorAndPostsCount {
      posts {
        uuid
        content
        author {
          id
          email
          _count {
            posts
          }
        }
      }
    }
    Now when relationResolvers are used, it returns proper data 🚀

0.23.3

18 Jan 13:45
Compare
Choose a tag to compare
0.23.3 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.9.0 💪
    No changes in DMMF detected, so no generated code should be affected.

  2. There is now a new generator option called emitRedundantTypesInfo. It allows you use other compilers that does not support emitDecoratorMetadata setting.
    You can read more about that in the docs: https://prisma.typegraphql.com/docs/advanced/emit-redundant-types-info

0.23.2

21 Dec 13:14
Compare
Choose a tag to compare
0.23.2 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.8.0 💪
    No changes in DMMF detected, so no generated code should be affected.

  2. Generated imports now use the type keyword, so TypeScript isolated modules setting is now supported (#324).

  3. The new clientExtensions preview feature support is still under ongoing research.
    Stay tuned for more info soon! 📻

0.23.1

30 Nov 13:32
Compare
Choose a tag to compare
0.23.1 Pre-release
Pre-release

Changelog

  1. Supported Prisma version has been bumped to v4.7.0 💪
    No changes in DMMF detected, so no generated code should be affected.

  2. The new clientExtensions preview feature support is under exploring, it might take some time to support virtual fields in GraphQL, etc.

  3. A few releases ago, the type-graphql peer deps version has been extended to support v2.0.0-beta.1 release.
    You can upgrade TypeGraphQL to use it together with GraphQL v16 🚀