Comments (9)
Quick update - we now have support for adding decorators to:
- crud resolvers
- output types (like
AggregateClient
) - model types
- input types
- args types
The last part to do is adding decorators to relation resolvers 👀
from typegraphql-prisma.
Actually, it's not a duplicate 😅
#11 refers to crud resolvers methods, however fields or relations also might need to set up authorization or other custom decorators.
Reopening to implement the same enhance map pattern but for model fields, as well as for input types (class-validator validation?) 😉
from typegraphql-prisma.
First iteration done in v0.9.1
:
https://github.com/MichalLytek/typegraphql-prisma/releases/tag/v0.9.1
Next release will focus on enhancing other output types and gonna allow to put decorators on the class itself, not only on its fields.
from typegraphql-prisma.
Reopening to implement the same enhance map pattern but for model fields, as well as for input types
from typegraphql-prisma.
Relation resolvers support has been added in 0dcc0f9, so closing this one 🔒
from typegraphql-prisma.
Duplicate of #11 🔒
from typegraphql-prisma.
Second iteration is also done in v0.9.2
🚀 You can now add decorators for both model class itself as well as its fields:
const modelsEnhanceMap: ModelsEnhanceMap = {
Director: {
class: [Extensions({ isDirector: true })],
fields: {
movies: [Authorized()],
},
},
};
applyModelsEnhanceMap(modelsEnhanceMap);
Third iteration will allow to decorate other object types like the aggregate ones.
from typegraphql-prisma.
Are there any plans for a applyInputTypesEnhanceMap
from typegraphql-prisma.
awesome!!! 💯
from typegraphql-prisma.
Related Issues (20)
- Incompatible types between prisma and typegraphql-prisma HOT 1
- Potential memory leak in generation with `@types/lodash` HOT 8
- Code is Generated Incorrectly for `0.27.0` HOT 3
- Omitted fields cannot be initialized HOT 2
- Naming a model "Function" in the schema.prisma crashes the generator HOT 1
- Many-To-Many relationship tables are required to have one non-relational field HOT 1
- TypeScript error in overloading UserResolver's deleteManyUser mutation HOT 2
- Possibly Incorrect Generated Type for `disconnect` in 0.27.1 HOT 8
- emitOnly readResolvers HOT 2
- _count resolver breaks when moving from Prisma 4 to Prisma 5 HOT 1
- Ability to add decorators to _count field
- ability to omit compound unique from typegraphql types HOT 5
- Encountered a JSON parsing error due to an extraneous comma in a TypeGraphQL decorator.
- 0.27.1: fields with undefined values present in args of generated types HOT 8
- Syntax error in a particular generated RelationsResolver HOT 1
- Incompatibility with Prisma 5.10.x: import_get_platform.binaryTargets is not iterable HOT 1
- JavaScript heap out of memory HOT 1
- update disconnect fails when disconnecting multiple items HOT 1
- compatibility issue in generated code for prisma v5 not assignable to type HOT 7
- Enforce pagination on generated resolvers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typegraphql-prisma.