We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If multiple middleware are added to the register_query_field, only the first one is ran e.g.
register_query_field
class FistMiddleware(object): def resolve(self, next, root, info, **args): print("Running first") return next(root, info, **args) class SecondMiddleware(object): def resolve(self, next, root, info, **args): print("Running second") return next(root, info, **args) @register_query_field("demo", middleware=[FistMiddleware, SecondMiddleware]) class Demo(models.Model): ....
Then the output is only 'Running first'. Switching the order means only second is outputted.
I think it's because of this line here where only the first field_middleware is returned in the loop instead of yielding all of them.
field_middleware
The text was updated successfully, but these errors were encountered:
@seb-b that is a great catch. Do you have time to submit a PR?
Sorry, something went wrong.
Fixes torchbox#227 run all middleware passed through decorators
e8bcc5a
28dd33d
No branches or pull requests
If multiple middleware are added to the
register_query_field
, only the first one is ran e.g.Then the output is only 'Running first'. Switching the order means only second is outputted.
I think it's because of this line here where only the first
field_middleware
is returned in the loop instead of yielding all of them.The text was updated successfully, but these errors were encountered: