graphql-hive 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15c7637ba2c6c51ec606a2c68e05f4628339b158df7659724c8ede14821d89ba
4
- data.tar.gz: fdccb249d2c98437b7a534ce22c99f14c2adaae26217af663d4757200f42a49f
3
+ metadata.gz: faf3390c1974107943ff70715481c0986b931b8d7eb8b3fb3f6e38899192d958
4
+ data.tar.gz: 345f4c6b5a14a83b96d596a007fa1b901c19230555e69f64ac2db421b851089b
5
5
  SHA512:
6
- metadata.gz: 1b3eb785900d0c7dc3595e49b4448c12e9b1aeb766d56872fcc9d25a4793f19bd456b709301c6d5388025869e3a2b52eeb695726922c7c39f1d705118e64676a
7
- data.tar.gz: 88f34e15f9037b9c979afee25f362ea2f7276d264c459c1ad2d724f3e75edc67bb40441acaa004bfac7993c515bbb4369dde06427df4ebc9dea868d136a38b14
6
+ metadata.gz: 36d075c01c81e9e9c1c359a05b1787227c0f13cf54f45437ef09cbfb72a95c53c6b1a83777e76ec724fbbe15af1fca9e65ec4ea1f451cc489500458a4c29eeec
7
+ data.tar.gz: d211dd70a405153f492254210c330f0d5fbd6e63d8d96a5267ec651eb8712654238780f997b1ee95a1f1bbbba5b1e1440a2539ec1ae1a9edeca1b61cbb537f18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql-hive (0.5.3)
4
+ graphql-hive (0.5.4)
5
5
  graphql (>= 2.3, < 3)
6
6
 
7
7
  GEM
@@ -24,6 +24,12 @@ module GraphQL
24
24
  request = build_request(uri, body)
25
25
  response = http.request(request)
26
26
 
27
+ code = response.code.to_i
28
+ if code >= 400 && code < 500
29
+ error_message = "Unsuccessful response: #{response.code} - #{response.message}"
30
+ @options[:logger].warn("#{error_message} #{extract_error_details(response)}")
31
+ end
32
+
27
33
  @options[:logger].debug(response.inspect)
28
34
  @options[:logger].debug(response.body.inspect)
29
35
  rescue => e
@@ -48,6 +54,14 @@ module GraphQL
48
54
  request.body = JSON.generate(body)
49
55
  request
50
56
  end
57
+
58
+ def extract_error_details(response)
59
+ parsed_body = JSON.parse(response.body)
60
+ return unless parsed_body.is_a?(Hash) && parsed_body["errors"].is_a?(Array)
61
+ parsed_body["errors"].map { |error| "{ path: #{error["path"]}, message: #{error["message"]} }" }.join(", ")
62
+ rescue JSON::ParserError
63
+ "Could not parse response from Hive"
64
+ end
51
65
  end
52
66
  end
53
67
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Graphql
4
4
  module Hive
5
- VERSION = "0.5.3"
5
+ VERSION = "0.5.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-hive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charly POLY
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-06 00:00:00.000000000 Z
11
+ date: 2024-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql