diff --git a/lib/graphql-hive/client.rb b/lib/graphql-hive/client.rb index 9e077d0..43f6465 100644 --- a/lib/graphql-hive/client.rb +++ b/lib/graphql-hive/client.rb @@ -57,8 +57,8 @@ def build_request(uri, body) def extract_error_details(response) parsed_body = JSON.parse(response.body) - return unless parsed_body.is_a?(Hash) && parsed_body['errors'].is_a?(Array) - parsed_body['errors'].map { |error| "path: #{error['path']}, message: #{error['message']}" }.join(", ") + return unless parsed_body.is_a?(Hash) && parsed_body["errors"].is_a?(Array) + parsed_body["errors"].map { |error| "path: #{error["path"]}, message: #{error["message"]}" }.join(", ") rescue JSON::ParserError nil end