Skip to content
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

Look into GraphQLite's new custom InputType validation hook #63

Open
oojacoboo opened this issue Jun 11, 2022 · 0 comments
Open

Look into GraphQLite's new custom InputType validation hook #63

oojacoboo opened this issue Jun 11, 2022 · 0 comments

Comments

@oojacoboo
Copy link
Collaborator

oojacoboo commented Jun 11, 2022

In GraphQLite version 6, this PR (thecodingmachine/graphqlite#435), provides support for the new SchemaFactory::setInputTypeValidator. With this new implementation, Input annotated objects can have validation triggered. This entirely removes the need for controller level calls in every method, and removes the possibility of a dev forgetting to do so.

This becomes a centralized place for all validation on all input types. Using it in conjunction with Symfony's annotation based validation is an obvious choice, among other possible custom needs.

This bundle would improve if it leveraged that as a default and fell back to manually calling validation when InputType objects are instantiated through a factory. Or, if someone would like to submit a PR to GraphQLite to extend the InputTypeValidatorInterface to support Factory constructed InputTypes as well, that'd be great.

Docs: https://graphqlite.thecodingmachine.io/docs/validation#custom-inputtype-validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant