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

Add function to check presense of operation context #1051

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

vektah
Copy link
Collaborator

@vektah vektah commented Feb 20, 2020

The new GetOperationContext panics if the context is not available, which makes logic errors more visible but there is no way to check for its presence before hand in places where you're not certain if it is excuting within an operation, like an error handler.

This PR adds a HasOperationContext function to make that check.

Alternativley, we could wind back the panic change, in favor of GetOperationContext() (ctx, ok). Thoughts?

@vektah vektah merged commit a53ce37 into master Feb 20, 2020
@vektah vektah deleted the has-operation-context branch February 20, 2020 03:04
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
Add function to check presense of operation context
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