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
get_middleware_resolvers is implemented as a generator:
get_middleware_resolvers
https://github.com/graphql-python/graphql-core-next/blob/f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b/graphql/execution/middleware.py#L56-L58
The generator object is then assigned to self._middleware_resolvers:
self._middleware_resolvers
https://github.com/graphql-python/graphql-core-next/blob/f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b/graphql/execution/middleware.py#L30-L32
As the generator is not consumed and unrolled into a list at this point, it is exhausted during the reduce() call of the first field construction:
reduce()
https://github.com/graphql-python/graphql-core-next/blob/f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b/graphql/execution/middleware.py#L46-L50
As the generator is now exhausted, all other calls to reduce() will immediately receive StopIteration so no other field is wrapped.
StopIteration
The text was updated successfully, but these errors were encountered:
Keep a list of middleware resolvers
883315d
Fixes graphql-python#15
4d03e85
Keep a list of middleware resolvers (#16)
6a9814d
This fixes #15
Thanks @patrys - I can confirm the issue and your fix, and added a regression test for this.
Sorry, something went wrong.
No branches or pull requests
get_middleware_resolvers
is implemented as a generator:https://github.com/graphql-python/graphql-core-next/blob/f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b/graphql/execution/middleware.py#L56-L58
The generator object is then assigned to
self._middleware_resolvers
:https://github.com/graphql-python/graphql-core-next/blob/f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b/graphql/execution/middleware.py#L30-L32
As the generator is not consumed and unrolled into a list at this point, it is exhausted during the
reduce()
call of the first field construction:https://github.com/graphql-python/graphql-core-next/blob/f6b078bddae4dd8a48ebf878a6fd5fbbac52bd1b/graphql/execution/middleware.py#L46-L50
As the generator is now exhausted, all other calls to
reduce()
will immediately receiveStopIteration
so no other field is wrapped.The text was updated successfully, but these errors were encountered: