github-community-projects / graphql-client

A Ruby library for declaring, composing and executing GraphQL queries
MIT License
42 stars 218 forks source link

Fix normalize error paths #4

Closed wuarmin closed 9 months ago

wuarmin commented 9 months ago

Hello :wave:, Thank you for continuing the project! I have already placed this PR in the old repository and therefore now here, because in my opinion it would still be relevant.

I'm consuming a GraphQL-interface, which returns error-payloads like that:

{
      "data": null,
      "errors": [
        {
          "message": "error",
          "path": null
        }
      ]
}

This caused a NoMethodError: undefined method `each' for nil:NilClass This PR would fix the behavior.

Thanks best regards Armin

rmosolgo commented 9 months ago

Hey, thanks for bringing this over here! I agree this would be a good improvement.