graphql-client 0.23.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphql/client/http.rb +6 -0
- data/lib/graphql/client/response.rb +7 -1
- data/lib/graphql/client.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9599ace170112e5e04ae479334661896f6c81337b3635006458303976d7e6a5
|
4
|
+
data.tar.gz: 24177d1923b56536e4da82de0a2965d9c2998617bbf17b02bc24764ba35de9cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87e0a8a6c0cdd9954be7994d00c3f9e06a269dbdeae8e3b79626fa19f3e32a755dc34ae2a590e3fa0149e3208c06021d806727d51b4decd3df5e21ae7e6b65ab
|
7
|
+
data.tar.gz: 33e919fe214424f9dbfc061d3a223d4b70e136303e5a4108c9ee9115a39c81f08e424580ea162600eba2f903935f2cb2580c76805201cc48111f89dd1cc07ad2
|
data/lib/graphql/client/http.rb
CHANGED
@@ -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
|
data/lib/graphql/client.rb
CHANGED
@@ -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.
|
4
|
+
version: 0.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|