Releases: MichalLytek/typegraphql-prisma
0.24.4
Changelog
-
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
orupdatedAt
are being frequently omitted from input types, which is cumbersome to manually maintain inschema.prisma
file for all the models. Hence there are now two new generator options that allows to omit by default some fields -omitInputFieldsByDefault
andomitOutputFieldsByDefault
, 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
Changelog
-
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 💪 -
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
Changelog
-
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
0.24.0
Changelog
-
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
Changelog
-
Supported Prisma version has been bumped to v4.10.0 💪
No changes in DMMF detected, so no generated code should be affected. -
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
Changelog
- 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 returningnull
for_count
:Now whenquery GetPostsWithAuthorAndPostsCount { posts { uuid content author { id email _count { posts } } } }
relationResolvers
are used, it returns proper data 🚀
0.23.3
Changelog
-
Supported Prisma version has been bumped to v4.9.0 💪
No changes in DMMF detected, so no generated code should be affected. -
There is now a new generator option called
emitRedundantTypesInfo
. It allows you use other compilers that does not supportemitDecoratorMetadata
setting.
You can read more about that in the docs: https://prisma.typegraphql.com/docs/advanced/emit-redundant-types-info
0.23.2
Changelog
-
Supported Prisma version has been bumped to v4.8.0 💪
No changes in DMMF detected, so no generated code should be affected. -
Generated imports now use the
type
keyword, so TypeScript isolated modules setting is now supported (#324). -
The new
clientExtensions
preview feature support is still under ongoing research.
Stay tuned for more info soon! 📻
0.23.1
Changelog
-
Supported Prisma version has been bumped to v4.7.0 💪
No changes in DMMF detected, so no generated code should be affected. -
The new
clientExtensions
preview feature support is under exploring, it might take some time to support virtual fields in GraphQL, etc. -
A few releases ago, the
type-graphql
peer deps version has been extended to supportv2.0.0-beta.1
release.
You can upgrade TypeGraphQL to use it together with GraphQL v16 🚀