Skip to content

WIP : Laravel Validator Implementation #12

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

Merged
merged 9 commits into from
Oct 8, 2019

Conversation

AurelGit
Copy link

@AurelGit AurelGit commented Oct 1, 2019

No description provided.

@AurelGit AurelGit changed the title Laravel Validator Implementation WIP : Laravel Validator Implementation Oct 1, 2019
@moufmouf
Copy link
Member

moufmouf commented Oct 2, 2019

We need to do some more work on the GraphQLite internals before merging this.

The @Validate annotation is hooked on the FieldMiddleware and therefore, cannot be used in Factories.

We should instead hook on the ParameterMapper, but the ParameterMapperInterface does not allow a "middleware" style parameter passing, so we cannot do a validation process (either return an error or delegate value processing to the next ParameterMapper. I need to refactor the ParameterMapper concept in order to allow validation of parameters.

@moufmouf
Copy link
Member

moufmouf commented Oct 7, 2019

Almost done. I still need to write the documentation and we are good to go!

@AurelGit
Copy link
Author

AurelGit commented Oct 8, 2019

It may be intersting to add a unit test for a multiple rule, for example :

* @Validate(for="bar", rule="gt:42|lt:100")

@moufmouf moufmouf merged commit b565915 into thecodingmachine:master Oct 8, 2019
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

Successfully merging this pull request may close these issues.

3 participants