-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support exclude_if and exclude_unless rule #1165
Conversation
It looks like the That seems like a really bad design decision from Laravel, are there any other validation rules that work like this? |
@spawnia |
I think we might not support this feature of Laravel. First of all, it just seems wrong to use validation to sanitize incoming data. It should be a discrete mechanism in a different step. Also, i don't think that masking client errors is a great idea in general. This behaviour is not transparent to clients. Without a description, there is no way for them to know that the argument they passed is going to be ignored. If the backend ever changes, there is no way for the client to know - the schema does not reflect that. In terms of implementation, changing the incoming data in a validation step breaks some assumptions that Lighthouse currently makes. We would have to go out of our way to support this, for instance, we would also need to mutate the |
@spawnia |
Thank you for your contribution and your understanding. Please don't let this discourage you, your PR certainly was well done and i very much welcome future contributions. I mentioned the fact that those rules are not supported in the directive definition, i am glad you brought it up: #1168. I hope the added section about sanitization helps you. |
- [ ] Added Docs for all relevant versionsChanges
Fixed an issue where
exclude_if
orexclude_unless
rules would not be excluded from args when applied.Breaking changes