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

GraphQL Ktor plugin swallows context exceptions. #1920

Open
dakriy opened this issue Jan 29, 2024 · 3 comments
Open

GraphQL Ktor plugin swallows context exceptions. #1920

dakriy opened this issue Jan 29, 2024 · 3 comments
Labels
type: bug Something isn't working

Comments

@dakriy
Copy link

dakriy commented Jan 29, 2024

Library Version
7.0.2

Describe the bug
When building a custom graphql context that throws an exception, the exception gets completely swallowed by the ktor graphql server plugin making it hard to figure out what the issue is.

To Reproduce
Make a custom context builder that throws an exception and visit the graphql endpoint. It will return a 400 bad request with no information anywhere.

Expected behavior
The exception should be thrown so that it can be handled by the ktor exception handler.

@dakriy dakriy added the type: bug Something isn't working label Jan 29, 2024
dariuszkuc added a commit that referenced this issue Apr 12, 2024
### 📝 Description
Currently, the Ktor version of the GraphQL server swallows a base
exception, which disallows any custom error responses. This PR moves
exception handling to
[statuspages](https://ktor.io/docs/status-pages.html), which is the
recommended error handler.

Note: This is a breaking change for people relying on the current
functionality to handle errors

### 🔗 Related Issues
#1920

---------

Co-authored-by: c <[email protected]>
Co-authored-by: Dariusz Kuc <[email protected]>
@curtiscook
Copy link
Contributor

Hi, @smyrick or @dariuszkuc, any word on which release version this change will ship with?

@smyrick
Copy link
Contributor

smyrick commented May 3, 2024

@curtiscook I am not a maintainer of the package anymore. You can reach out to the contact info provided in the repo

Also it was indicated in the PR that the release would happen after graphql-java: #1936 (comment)

@curtiscook
Copy link
Contributor

@curtiscook I am not a maintainer of the package anymore. You can reach out to the contact info provided in the repo

Also it was indicated in the PR that the release would happen after graphql-java: #1936 (comment)

Oops! Thanks, sorry I missed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

3 participants