graphql-client 0.23.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ab40176a982910f10885b2c56a3d3ad867937ee4f824a4af06e75993236f1f0
4
- data.tar.gz: 291c8ed2700b79bf5b41c2f799899dac7316d000b04e9cdeaae87cea0519e411
3
+ metadata.gz: 9b32099b8cdce1e28ecf96369d6bb5d968f2ca1588300c0835143f506043a9a5
4
+ data.tar.gz: 5ebb924c07aa85a7e99571d4cd9634a8d082e5a9a68fee61b959cf88d3f4f60e
5
5
  SHA512:
6
- metadata.gz: 8a5a4cc5b341c302c1c2b20a12d10b59907a34ca9d50871e1e48c2984dbdf8562eb40eab123f6474eb96024ca6eeaa08f4ebf3c043dacb0e46f3211a3c00b921
7
- data.tar.gz: 6cba9520177116c4d332578bee01f98a42adff2cba51ca123f7083a6980826725db7f090fcd8c37debdb3c654b7cac4b27b21e7f1f86d6a76b4e8676340d8f08
6
+ metadata.gz: 2a92a54fe34a420f8604c814f9d09ac527fbcad624fb3268d1149c19e21824bfd8e48546e4d55f386758d7cdbee95250233d9b583bf5e0503180c917bed443e8
7
+ data.tar.gz: 945912bf1aae2ce10307b6067e06ed8a2e9aa8da5c4a305fc7dd83340def11eb2dad368cc5b7a469e328403bdcc9bfa059833ed4f0bc487a231b9014f03eb2fa
@@ -14,7 +14,7 @@ module GraphQL
14
14
  # Assumes GraphQL endpoint follows the express-graphql endpoint conventions.
15
15
  # https://github.com/graphql/express-graphql#http-usage
16
16
  #
17
- # Production applications should consider implementing there own network
17
+ # Production applications should consider implementing their own network
18
18
  # adapter. This class exists for trivial stock usage and allows for minimal
19
19
  # request header configuration.
20
20
  class HTTP
@@ -45,6 +45,11 @@ module GraphQL
45
45
  {}
46
46
  end
47
47
 
48
+ # Public: full reponse from last request
49
+ #
50
+ # Returns Hash.
51
+ attr_reader :last_response
52
+
48
53
  # Public: Make an HTTP request for GraphQL query.
49
54
  #
50
55
  # Implements Client's "execute" adapter interface.
@@ -71,6 +76,7 @@ module GraphQL
71
76
  request.body = JSON.generate(body)
72
77
 
73
78
  response = connection.request(request)
79
+ @last_response = response.to_hash
74
80
  case response
75
81
  when Net::HTTPOK, Net::HTTPBadRequest
76
82
  JSON.parse(response.body)
@@ -31,12 +31,18 @@ module GraphQL
31
31
  # Public: Hash of server specific extension metadata.
32
32
  attr_reader :extensions
33
33
 
34
+ # Public: Complete response hash returned from server.
35
+ #
36
+ # Returns Hash
37
+ attr_reader :full_response
38
+
34
39
  # Internal: Initialize base class.
35
- def initialize(hash, data: nil, errors: Errors.new, extensions: {})
40
+ def initialize(hash, data: nil, errors: Errors.new, extensions: {}, full_response: nil)
36
41
  @original_hash = hash
37
42
  @data = data
38
43
  @errors = errors
39
44
  @extensions = extensions
45
+ @full_response = full_response
40
46
  end
41
47
  end
42
48
  end
@@ -380,12 +380,12 @@ module GraphQL
380
380
  error_payload = payload.merge(message: error["message"], error: error)
381
381
  ActiveSupport::Notifications.instrument("error.graphql", error_payload)
382
382
  end
383
-
384
383
  Response.new(
385
384
  result,
386
385
  data: definition.new(data, Errors.new(errors, ["data"])),
387
386
  errors: Errors.new(errors),
388
- extensions: extensions
387
+ extensions: extensions,
388
+ full_response: execute.respond_to?("last_response") ? execute.last_response : nil
389
389
  )
390
390
  end
391
391
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-17 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 13.1.0
103
+ version: 13.2.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 13.1.0
110
+ version: 13.2.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop-github
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.64.1
131
+ version: 1.66.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.64.1
138
+ version: 1.66.1
139
139
  description: A Ruby library for declaring, composing and executing GraphQL queries
140
140
  email: engineering@github.com
141
141
  executables: []
@@ -185,7 +185,7 @@ licenses:
185
185
  - MIT
186
186
  metadata:
187
187
  rubygems_mfa_required: 'true'
188
- post_install_message:
188
+ post_install_message:
189
189
  rdoc_options: []
190
190
  require_paths:
191
191
  - lib
@@ -200,8 +200,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  requirements: []
203
- rubygems_version: 3.5.9
204
- signing_key:
203
+ rubygems_version: 3.5.12
204
+ signing_key:
205
205
  specification_version: 4
206
206
  summary: GraphQL Client
207
207
  test_files: []