-
-
Notifications
You must be signed in to change notification settings - Fork 748
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
Error code from GraphQL is not correct in StrawberryShake #4596
Comments
In the generated code:
I guess |
If I add a custom IHttpResultSerializer and make sure that my server returns http status code 200 for my custom, "expected" errors, everything is mapped ok in StrawberryShake. But I'm still not sure how this is supposed to work. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@michaelstaib @PascalSenn I'd like to take a crack at this one |
Are you on slack? Slack.Chillicream.com? Ping me there |
Just pinged you |
This issue is now fixed. |
Is there an existing issue for this?
Describe the bug
I expected my StrawberryShake client to return error codes from the GraphQL response, but
result.Errors[0].Code
is null. The error code can be found insideresult.Errors[0].Extensions["body"]
, but I assume that this is not how this is intended to work? Perhaps some sort of serialization bug?I made a quick reproduction here: https://github.com/thomastvedt/HotChocolateBug
The following mutation:
results in the following GraphQL response:
When running the console app with the generated StrawberryShake client I get the following result:
I was expecting to find my
CUSTOM_ERROR_CODE
underresult.Errors[0].Code
, but this isnull
.Is this a bug or expected?
Steps to reproduce
I made a quick reproduction here: https://github.com/thomastvedt/HotChocolateBug
Relevant log output
No response
Additional Context?
No response
Product
Strawberry Shake
Version
12.4.1
The text was updated successfully, but these errors were encountered: