Is it possible to contextualize omitted fields via middleware? #254
Unanswered
jeffDevelops
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This library is amazing. Thank you for your excellent work!
I'm using the new
omit
features inv0.19.0
, and it works great for fields with default values in prisma likecreatedAt
, but I'd like to not exposecreatedBy
andupdatedBy
in my API:I have a middleware that adds a user from cookies to
context
, and I'd like to use the generatedCreateFooResolver
, but the mutation fails at the Prisma layer withbecause I'm omitting it from the mutation.
Is it possible to write a decorator middleware to inject the
createdBy
andupdatedBy
values from context, or would I need to write a customCreateFooResolver
?Beta Was this translation helpful? Give feedback.
All reactions