Releases: MichalLytek/typegraphql-prisma
0.10.1
Changelog
-
In
v2.15
Prisma has stabilized the feature of modifying relations by directly setting foreign keys.
Thev0.10.1
release has added support for thatuncheckedScalarInputs
by adding a generator optionuseUncheckedScalarInputs = true
. You can read more about that in the docs. -
In
v2.14
Prisma has added agroupBy
preview feature.
Thev0.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
Changelog
-
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 Prismav2.15
.- Prisma
v2.15
supports counting of records using select - simplecount: number
aggregation were replaced by the richXYZCountAggregate
object types, so you need to refactor your queries to usecount { _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
- Prisma
-
Support for the stabilized
uncheckedScalarInputs
feature and thegroupBy
preview feature is under ongoing work, so stay tuned as it's planned to be released soon 😉
0.9.4
Changelog
-
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 😉 -
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
Changelog
-
The supported Prisma 2 version has been upgraded to
v2.13.1
. Please make sure you've updated Prisma before updatingtypegraphql-prisma
. -
This release enhance the ability for applying additional decorators for Prisma schema generated classes via the enhance configs.
Sincev0.9.3
it's possible to add decorators to all output types likeAggregateFooBar
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
Changelog
-
The supported Prisma 2 version has been upgraded to
v2.13.0
.
Because of the changes in DMMF, the name of the enums is nowFooBarScalarFieldEnum
instead ofFooBarDistinctFieldEnum
, so be aware of that. -
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 from0.9.1
to0.9.2
:const modelsEnhanceMap: ModelsEnhanceMap = { Director: { + fields: { movies: [Authorized()], + }, }, };
Since
v0.9.2
you can now provideclass
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
Changelog
-
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 generatesapplyModelsEnhanceMap
function andModelsEnhanceMap
type, similar toResolversEnhanceMap
. 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
Changelog
-
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 fortypegraphql-prisma
. -
Because of the changes in DMMF, all the
FindOne
prefixed classes and types are now emitted withFindUnique
prefix, so you need to adjust your imports if needed. -
The underlying resolvers code is now using
prisma.findUnique
method, as well as the queries name hasfindUnique
prefix.
So if you useduseOriginalMapping = true
option, your client queries might stop working so be aware of that while upgrading.
0.8.5
Changelog
-
New version contains a fix for small Prisma schemas with 1-1 relations, where relation resolvers doesn't have any args (#28).
-
It's now possible to suppress the prisma version runtime check using env var
SKIP_PRISMA_VERSION_CHECK=true
(#31).
This allows to usetypegraphql-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
Changelog
-
typegraphql-prisma
has been updated to work with with Prismav2.11.0
. It means that now thecreateOrConnect
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.
-
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
Changelog
-
It now works with Prisma
v2.10.1
- since this version atomic updates are automatically emitted in generated schema. -
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 andresolvers
array with yet anotherXYZCrudResolver
.Thanks to this, using
typegraphql-prisma
requires 0 boilerplate 🚀import { resolvers } from "@generated/type-graphql"; const schema = await buildSchema({ resolvers, validate: false, });