Brakebein / prisma-generator-nestjs-dto

Generates NestJS DTO classes from Prisma Schema
Apache License 2.0
51 stars 28 forks source link

GraphQL Support #60

Open Stackclash opened 6 days ago

Stackclash commented 6 days ago

Would it be possible to add GraphQL annotation support to this generator?

https://docs.nestjs.com/graphql/resolvers#object-types

There is overlap between what is already supported and information that the GraphQL annotations need.

Scalar typer inference is a little different for GraphQL, but @description can be used for the field descriptions. All of the annotations from class-transformer and class-validator also work with GraphQL.

Brakebein commented 2 days ago

I haven't done anything yet with GraphQL, so I won't be able to properly validate the generated output. From the first look at the docs I can see that the decorators and syntax are quite different or kind of special. Hence, it probably needs some bigger adaptions to the code. Actually, it's hard to estimate. However, I don't currently have the time to dive into the topic that deeply. Sorry for that. But feel free to make a PR.