Closed railsstudent closed 1 year ago
Hi @railsstudent.
The @QueryWithZod(UserZod)
would run the validations before the function returns, and @Query
simply checks the type of the returned object, not the fields. I may provide another decorator that will simply run the validations without touching the @Query
decorator. If I can find a way or have a suggestion, then I'll tell you.
Awesome. I really like this library because it combines the goodies of class-validator, graphql-scalar and graphql-validation-directive without the hassle of adding typdef and creating GraphQLDirectives.
I hope it can support my use case and propose it to team leads .
If I use @Query decorator to return a type created by modelFromZod, zod validations are not executed. I use refine() to ensure lat and lng return valid latitude and longitude.
Since my POC is a Apollo federated graph, I need to create a custom model and place Directive decorator above the class.
When I execute the query, console log statements not printed in terminal. If I use QueryWithZod and test on the subgraph, console log statement printed
This is a good library and but I think it tailors to standalone GraphQL and can extend to suport Apollo federated graph