Skip to content

Strawberry integration doesn't work with newest strawberry-graphql release #4037

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

Closed
sentrivana opened this issue Feb 11, 2025 · 1 comment · Fixed by #4026
Closed

Strawberry integration doesn't work with newest strawberry-graphql release #4037

sentrivana opened this issue Feb 11, 2025 · 1 comment · Fixed by #4026

Comments

@sentrivana
Copy link
Contributor

sentrivana commented Feb 11, 2025

The newest Strawberry version removes the execute and execute_sync functions that we were monkeypatching in favor of integrating the code directly in Schema.execute and Schema.execute_sync.

We were previously patching execute instead of Schema.execute because that way we had access to a populated execution_context which contains data that we wanted to put on the event via an event processor.

We also have access to the execution_context directly in the extension hooks Strawberry provides, so we can add the event processor there instead of monkeypatching anything.

@sentrivana sentrivana self-assigned this Feb 11, 2025
sentrivana added a commit that referenced this issue Feb 11, 2025
New Strawberry version removes the `execute` and `execute_sync`
functions that we were monkeypatching in favor of integrating the code
directly in `Schema.execute` and `Schema.execute_sync`.

We were previously patching `execute` instead of `Schema.execute` that's
calling it because that way we had access to a populated
`execution_context` which contains data that we wanted to put on the
event via an event processor.

We have access to the `execution_context` directly in the extension
hooks Strawberry provides, so we now add the event processor there
instead of monkeypatching anything.

This should also work for older Strawberry versions, so shouldn't be
necessary to keep the old implementation around for compat.

Closes #4037
@sentrivana
Copy link
Contributor Author

A release with this in it will be out in the next couple of days!

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

Successfully merging a pull request may close this issue.

1 participant