Anyone know how to apply validations for your sche...
# orm-help
t
Anyone know how to apply validations for your schema? Let’s say I have a User which have multiple Posts. Now a Post can be created using createPost and also using createUser (Creating related records). I found this great article to put validations and used it: https://itnext.io/graphql-mutation-arguments-validation-with-yup-using-graphql-middleware-645822fb748 But there’s a problem. If I need to add validation to Post, I need to put the validation in both Post and User create functions. So, my question is, how to do this properly?
n
I'm using a mix of yup and graphql directives, but maybe you should check https://github.com/maticzav/graphql-shield