You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey all, I have a bit of a weird use case that I'm wondering if I can make work with type-graphql+prisma. Basically, I'm building a multi-tenanted application where every model in my schema has two unique ID fields: @@unique([id, organizationId]) Users should only ever be able to query and mutate data in their respective organization.
We want to automatically infer the organizationId for every request using data in the context's currentUser and merge that into the where field for every CRUD operation.
The question is: what's the best way to set this up so that I can use as much of the auto-generated CRUD/RelationResolvers from typegraphql-prisma without needing to recreate all of the resolvers by hand? Is this even possible?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey all, I have a bit of a weird use case that I'm wondering if I can make work with type-graphql+prisma. Basically, I'm building a multi-tenanted application where every model in my schema has two unique ID fields:
@@unique([id, organizationId])
Users should only ever be able to query and mutate data in their respective organization.We want to automatically infer the organizationId for every request using data in the context's currentUser and merge that into the
where
field for every CRUD operation.The question is: what's the best way to set this up so that I can use as much of the auto-generated CRUD/RelationResolvers from
typegraphql-prisma
without needing to recreate all of the resolvers by hand? Is this even possible?Beta Was this translation helpful? Give feedback.
All reactions