Skip to content

How to validate InputType fields with dependent rules? #790

Answered by mfn
downace asked this question in Q&A
Discussion options

You must be logged in to vote

I basically agree and I don't have much of a solution to offer.

I suffer similar things on other ends: I want great GraphQL validation (and that means: not just the types) so I too do also make use of the rules. But GraphQL is just a layer, the business logic is spread over multiple modules, each which have to validate the input anyway again. So I end up trying my best to "share" the validations but that's not always possible with repeatable and dependable fields.

And I agree also in your scenario, it gets less useful if you can't couple the Input in some way and doing it in the query/mutation resolve needs implicit knowledge what the input is.

The ability to have rules directly being val…

Replies: 2 comments 1 reply

Comment options

mfn
Jun 2, 2021
Collaborator

You must be logged in to vote
1 reply
@downace
Comment options

Answer selected by downace
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants