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

Allow checking if Response Context exists #3388

Open
adrianlungu opened this issue Nov 25, 2024 · 0 comments
Open

Allow checking if Response Context exists #3388

adrianlungu opened this issue Nov 25, 2024 · 0 comments

Comments

@adrianlungu
Copy link

What happened?

The panic approach to treat cases when a Gqlgen related context is missing can cause unexpected issues when you have some helper func depending on one of the contexts to do something.

i.e. in our case, we have some helper functions that use the AddError and GetErrors but have no way to check if HasResponseContext similar to how we check if HasOperationContext based on the current API.

What did you expect?

Have a function HasResponseContext to be able to check if it exists and prevent panic if it does not in code using gqlgen funcs that require the Response Context to exist.

Minimal graphql.schema and models to reproduce

N/A

versions

  • the main branch still does not have a way to check if Response Context exists.
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

No branches or pull requests

1 participant