Open straygar opened 9 months ago
Hey @straygar, Thank you for requesting this. We are marking this as a feature request for the team to evaluate futher.
@straygar , I'm still a pretty new dev and learning all of this. I thought I had a handle on how to securely validate data before I moved to amplify. Now I'm not so sure.
Why would this be an issue just for mutations? Why not also for something like:
await client.models.Posts.create(data)
@TheRealBenForce is a creation also not a mutation in graphql land?
@TheRealBenForce is a creation also not a mutation in graphql land?
- query - read-only operations
- mutation - everything else
I agree. The gen 2 docs have a separate section for mutations but I see now it is for custom mutations
Describe the feature you'd like to request
Using GraphQL mutations, users can perform write operations against the Datastore. However, there is currently no simple way to perform field validation before the data is written.
Describe the solution you'd like
A zod-like interface in Gen2 in combination with graphql-constraint-directive used in the GraphQL schema is a good fit for this:
Describe alternatives you've considered
Additional context
No response
Is this something that you'd be interested in working on?
Would this feature include a breaking change?