Skip to content

Releases: MichalLytek/typegraphql-prisma

0.10.1

27 Jan 16:13
Compare
Choose a tag to compare
0.10.1 Pre-release
Pre-release

Changelog

  1. In v2.15 Prisma has stabilized the feature of modifying relations by directly setting foreign keys.
    The v0.10.1 release has added support for that uncheckedScalarInputs by adding a generator option useUncheckedScalarInputs = true. You can read more about that in the docs.

  2. In v2.14 Prisma has added a groupBy preview feature.
    The v0.10.1 release now supports that and generates all the required "group by" resolvers, input and output types, so you can now execute such complex queries:

    query GroupPosts {
      groupByPost(
        by: [kind]
        where: {
          author: {
            is: { id: { equals: 2 } }
          }
        }
      ) {
        kind
        count {
          _all
        }
      }
    }

0.10.0

20 Jan 15:13
Compare
Choose a tag to compare
0.10.0 Pre-release
Pre-release

Changelog

  1. New Prisma release 2.15 is now supported. It contains some breaking changes (in DMMF, namespace export), that's why it's a major v0.10 release compatible only with newest Prisma v2.15.

    • Prisma v2.15 supports counting of records using select - simple count: number aggregation were replaced by the rich XYZCountAggregate object types, so you need to refactor your queries to use count { _all }
    • JSON type helpers are nowe mitted under Prisma namespace, so all the generated classes will contain the according change for that
    • there might be some ghost changes emitted in the generated classes (like removing description: undefined,) because of the internal cleanup in the codebase
  2. Support for the stabilized uncheckedScalarInputs feature and the groupBy preview feature is under ongoing work, so stay tuned as it's planned to be released soon 😉

0.9.4

06 Jan 15:27
Compare
Choose a tag to compare
0.9.4 Pre-release
Pre-release

Changelog

  1. New Prisma release 2.14 is now supported. Because the types naming bug in Prisma has been fixed, it contains changes in the compound input names, so be aware of that while upgrading.

    v0.9.4 however doesn't support yet the new preview feature - the "Group By queries". Expect this to arrive in the next release soon 😉

  2. This releases fixes a typo in applyOutputs - please adjust your imports and usage in the code, if you already use that feature:

    - import { applyOutputTypeEnhanceMap, OutputTypeEnhanceMap } from "./generated/prisma";
    + import { applyOutputTypesEnhanceMap, OutputTypesEnhanceMap } from "./generated/prisma";

0.9.3

23 Dec 15:43
Compare
Choose a tag to compare
0.9.3 Pre-release
Pre-release

Changelog

  1. The supported Prisma 2 version has been upgraded to v2.13.1. Please make sure you've updated Prisma before updating typegraphql-prisma.

  2. This release enhance the ability for applying additional decorators for Prisma schema generated classes via the enhance configs.
    Since v0.9.3 it's possible to add decorators to all output types like AggregateFooBar and others, in the similar way like for model types:

    const aggregateClientConfig: OutputTypeConfig<"AggregateClient"> = {
      fields: {
        avg: [Extensions({ complexity: 10 })],
      },
    };
    applyOutputTypeEnhanceMap({
      AggregateClient: aggregateClientConfig,
      ClientAvgAggregate: {
        fields: {
          age: [Authorized()],
        },
      },
    });

    More info in docs:
    https://github.com/MichalLytek/typegraphql-prisma/blob/v0.9.3/Readme.md#additional-decorators-for-prisma-schema-classes-and-fields

0.9.2

16 Dec 16:39
Compare
Choose a tag to compare
0.9.2 Pre-release
Pre-release

Changelog

  1. The supported Prisma 2 version has been upgraded to v2.13.0.
    Because of the changes in DMMF, the name of the enums is now FooBarScalarFieldEnum instead of FooBarDistinctFieldEnum, so be aware of that.

  2. This release enhance the ability for applying additional decorators for Prisma schema model types via the model configs.

    To make that possible, the shape of ModelsEnhanceMap config has been changed, so be aware that you need to update your code when updating from 0.9.1 to 0.9.2:

     const modelsEnhanceMap: ModelsEnhanceMap = {
      Director: {
    +   fields: {
          movies: [Authorized()],
    +   },
      },
    };

    Since v0.9.2 you can now provide class property with array of class decorators which will be applied on the model class:

    const modelsEnhanceMap: ModelsEnhanceMap = {
      Director: {
        class: [Extensions({ isDirector: true })],
        fields: {
          movies: [Authorized()],
        },
      },
    };

    You can read more about that feature in the docs:
    https://github.com/MichalLytek/typegraphql-prisma/blob/v0.9.2/Readme.md#additional-decorators-for-prisma-schema-model-fields

0.9.1

03 Dec 15:50
Compare
Choose a tag to compare
0.9.1 Pre-release
Pre-release

Changelog

  1. This release continues to follow the pattern introduced with applying additional decorators for Prisma schema resolvers via the resolver actions configs.

    This time it adds support for adding decorators (@Authorized, @Extensions or custom ones) to Prisma models @ObjectType class fields.
    It generates applyModelsEnhanceMap function and ModelsEnhanceMap type, similar to ResolversEnhanceMap. You can find more info about this feature in docs:
    https://github.com/MichalLytek/typegraphql-prisma/blob/v0.9.1/Readme.md#additional-decorators-for-prisma-schema-model-fields

0.9.0

26 Nov 16:13
Compare
Choose a tag to compare
0.9.0 Pre-release
Pre-release

Changelog

  1. Main focus for this release was the compatibility with the Prisma v2.12 release which had a lot of breaking changes both internally and externally for typegraphql-prisma.

  2. Because of the changes in DMMF, all the FindOne prefixed classes and types are now emitted with FindUnique prefix, so you need to adjust your imports if needed.

  3. The underlying resolvers code is now using prisma.findUnique method, as well as the queries name has findUnique prefix.
    So if you used useOriginalMapping = true option, your client queries might stop working so be aware of that while upgrading.

0.8.5

18 Nov 13:04
Compare
Choose a tag to compare
0.8.5 Pre-release
Pre-release

Changelog

  1. New version contains a fix for small Prisma schemas with 1-1 relations, where relation resolvers doesn't have any args (#28).

  2. It's now possible to suppress the prisma version runtime check using env var SKIP_PRISMA_VERSION_CHECK=true (#31).
    This allows to use typegraphql-prisma together with newer, not tested Prisma versions.

    You can use that feature only on your own responsibility as because of Prisma DMMF changes in minor releases, the generator can just break. Please don't open any issues related to newer, unsupported Prisma versions.

0.8.4

11 Nov 18:09
Compare
Choose a tag to compare
0.8.4 Pre-release
Pre-release

Changelog

  1. typegraphql-prisma has been updated to work with with Prisma v2.11.0. It means that now the createOrConnect API is turned on by default, so it will be emitted in the schema.

    Also, the new Prisma version changes some input type names, so be aware of that while upgrading.

  2. New feature has been added - support for enhancing generated Prisma schema resolvers with decorators (#11).

    It works by defining a special object called config/map, when you "register" the decorators like for a normal class method (Authorized, UseMiddleware, etc.).
    You can read more about that feature in Readme:
    https://github.com/MichalLytek/typegraphql-prisma#additional-decorators-for-prisma-schema-resolvers

0.8.3

30 Oct 13:30
Compare
Choose a tag to compare
0.8.3 Pre-release
Pre-release

Changelog

  1. It now works with Prisma v2.10.1 - since this version atomic updates are automatically emitted in generated schema.

  2. New release contains a new feature - emit export of all generated resolvers (#20).
    It can be super useful in the prototype phase, when you don't what to remember about manually updating imports and resolvers array with yet another XYZCrudResolver.

    Thanks to this, using typegraphql-prisma requires 0 boilerplate 🚀

    import { resolvers } from "@generated/type-graphql";
    
    const schema = await buildSchema({
      resolvers,
      validate: false,
    });