graphql-client
graphql-client copied to clipboard
handle nil values for error paths
This relates to #146, specifically the point raised by a commenter at the end of the thread.
Perhaps there's a cleaner way to do this, but we have a case where the below response causes fails on GraphQL::Client::Errors.normalize_error_paths
due to error["path"]
being the value nil
. I copied an existing test assertion and (rather than a simple error["path"] || []
)actually deleted the nil
path
key from the error object to match the behavior of other examples.
Interested in your thoughts- thanks.
Snippet of the offending graphql response:
{
"errors": [
{
"message": "Response not successful: Received status code 401",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": null,
"stack": null
}
],
Following the thread in the hidden comment above I've updated this to explicitly set empty/nil error['path']
s to []
, which changes the tests a little bit but seems safer than continuing to pass a path: nil
around the rest of the request cycle. Still open to changes.
Are there any plans for when this PR will be merged? I'm facing a similar issue and was forced to fork this gem locally to add in this fix. It would be great to see it in an official release soon.
Poke, we'd love to ge this upstream
+1 for this. just had to patch this in to my graphql-client gem to see an "internal server error" that was being obscured by this bug
:wave: Hello! I don't believe my team is using this fork anymore. If this PR is not going to be merged could we please close it?
This is still an issue with appsync btw. Is there any plans to resolve? Thanks.