Skip to content

Add UnforgivingExecutionContext #1255

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

Conversation

AlecRosenbaum
Copy link
Contributor

Resolves: #902

I'm not sure what the best place to add this execution context is. I'm happy to change naming and where this is defined to whatever is most appropriate.

Assuming this approach looks good, this probably also warrants some updates to the docs before merging.

Note that I have not added this as the default execution context since that would be a pretty breaking change. If a breaking change is ok, I'll update this PR.

In the project where I've taken a similar approach, I also added an assert graphl.version == '3.1.1' as a reminder to check the underlying implementation for changes when bumping versions. It might be worth adding a similar check here as well

@AlecRosenbaum AlecRosenbaum marked this pull request as ready for review August 20, 2020 12:17
@AlecRosenbaum
Copy link
Contributor Author

@jkimbo I don't think I have access to request a review. What's the process from here?

@AlecRosenbaum
Copy link
Contributor Author

@jkimbo @syrusakbary I've updated this PR with fixes for an issue I found when using this in a different project.

What are the next steps for either accepting or rejecting this change?

Copy link
Contributor

@zbyte64 zbyte64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the interface and the results.
🚀

Copy link
Member

@jkimbo jkimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay @AlecRosenbaum . This looks great thanks!

@jkimbo jkimbo merged commit e24ac54 into graphql-python:master Oct 21, 2020
@jkimbo
Copy link
Member

jkimbo commented Oct 21, 2020

Released as v3.0.0b6

@jkimbo jkimbo mentioned this pull request Oct 21, 2020
@coler-j
Copy link

coler-j commented Nov 22, 2020

@AlecRosenbaum any docs for how to use this?

@AlecRosenbaum AlecRosenbaum deleted the add-unforgiving-execution-context branch November 24, 2020 19:25
@zbyte64
Copy link
Contributor

zbyte64 commented Nov 28, 2020

@AlecRosenbaum any docs for how to use this?

No docs yet but I pulled this from the unit tests:

           schema.execute(
                f"query {{ {field} }}",
                execution_context_class=UnforgivingExecutionContext,
            )

@AlecRosenbaum
Copy link
Contributor Author

Sorry @coler-j, I meant to respond to this but got distracted.

The unit test example above is probably the best example of how to use it. In the project I use this, we do some other custom stuff that wouldn't show the usage very well.

@weilu
Copy link

weilu commented Jun 9, 2021

This no longer works with graphene 3.1.5 as resolve_field_value_or_error is removed. The fix is rather simple: weilu@bec2191, but I haven't had time to look into tests so I'm just leaving this here to save time for those who have the same issue.

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.

Error handling
5 participants