drizzle-team / drizzle-graphql

Automatically generate GraphQL schema or customizable schema config fields from Drizzle ORM schema
https://www.npmjs.com/package/drizzle-graphql
Apache License 2.0
34 stars 1 forks source link

Question : recipe to omit a field ? To expand an object ? #17

Open olup opened 5 days ago

olup commented 5 days ago

Is there a simple way to hide a field from an object ? Or to add a custom one ?

Sukairo-02 commented 5 days ago

Unfortunately no, since we generate handlers from table schemas. You could though make a custom data type, make a wrapper around original handler and omit\add fields in said wrapper after original handler processes it's operation.

olup commented 4 days ago

Can we imagine a way to declare fields / methods to omit in the original drizzle schéma ? I never checked if the drizzle schéma can be extended with custom props, I guess not. But this is a typical use case in Prisma land that would be very beneficial here as well.