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

Migrating ParameterHandler to a middleware system #139

Merged
merged 3 commits into from
Oct 4, 2019

Conversation

moufmouf
Copy link
Member

@moufmouf moufmouf commented Oct 2, 2019

Currently the ParameterMapperInterface only allows for a handler to handle or not handle a parameter.
There is no way a ParameterMapper can "wrap" other parameter handlers. So there is no easy way to write a ParameterMapper that does validation upon the result of other parameter handlers.

This commit moves ParameterMapperInterface to a system of ParameterMiddlewareInterface where parameter middlewares are chained.
We therefore get all the benefits of middlewares when handling parameters.

  • Migrate to ParameterMiddlewareInterface
  • Update doc

Currently the ParmeterHandlerInterface only allows for a handler to handle or not handle a parameter.
There is no way a ParameterHandler can "wrap" othe parameter handlers. So there is no easy way to write a ParameterHandler that does validation upon the result of other parameter handlers.

This commit moves ParameterMapperInterface to a system of ParameterMiddlewareInterface where parameter middlewares are chained.
We therefore get all the benefits of middlewares when handling parameters.
@moufmouf
Copy link
Member Author

moufmouf commented Oct 2, 2019

Note: this makes thecodingmachine/graphqlite-laravel#12 possible

…eate ParameterInterface that behaves like real input type (for Validators))
@moufmouf moufmouf merged commit 18fc02c into thecodingmachine:master Oct 4, 2019
@moufmouf moufmouf deleted the parameter_middlewares branch October 4, 2019 09:29
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.

None yet

1 participant