graphql-client 0.22.0 → 0.24.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: 4064d832c0bf6433b6b6629c50d5c20182164bb6e870661d670fd6ba3ab0ecdc
4
- data.tar.gz: 21f4aea0033c36f86d14ae4fe52294ae0193cc1485154cf3b15519b9ac0b8d8f
3
+ metadata.gz: e9599ace170112e5e04ae479334661896f6c81337b3635006458303976d7e6a5
4
+ data.tar.gz: 24177d1923b56536e4da82de0a2965d9c2998617bbf17b02bc24764ba35de9cb
5
5
  SHA512:
6
- metadata.gz: 4507464c1a14fcac7aecaacf07d9b8297f288b717d7c59e12368426b427d5bdeacf7c19fd3e037df8d26482ad719b8edfc2dd26665d8d59518a10720ab1968c0
7
- data.tar.gz: f1c34616ea07b5bb4926f7489225859b3b9bff50485a90d74a55f9ce4e4aca74eeb5420cb793522470de9ac3ccbf85628ac0d3c3b0e01955024aebaf5a420d37
6
+ metadata.gz: 87e0a8a6c0cdd9954be7994d00c3f9e06a269dbdeae8e3b79626fa19f3e32a755dc34ae2a590e3fa0149e3208c06021d806727d51b4decd3df5e21ae7e6b65ab
7
+ data.tar.gz: 33e919fe214424f9dbfc061d3a223d4b70e136303e5a4108c9ee9115a39c81f08e424580ea162600eba2f903935f2cb2580c76805201cc48111f89dd1cc07ad2
@@ -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
@@ -100,6 +100,11 @@ module GraphQL
100
100
  @enforce_collocated_callers = enforce_collocated_callers
101
101
  if schema.is_a?(Class)
102
102
  @possible_types = schema.possible_types
103
+ key, _types = @possible_types.first
104
+ # GraphQL-Ruby 2.3.5+ has classes here instead of strings
105
+ if key.is_a?(Module)
106
+ @possible_types = @possible_types.transform_keys(&:graphql_name)
107
+ end
103
108
  end
104
109
  @types = Schema.generate(@schema, raise_on_unknown_enum_value: raise_on_unknown_enum_value)
105
110
  end
@@ -375,12 +380,12 @@ module GraphQL
375
380
  error_payload = payload.merge(message: error["message"], error: error)
376
381
  ActiveSupport::Notifications.instrument("error.graphql", error_payload)
377
382
  end
378
-
379
383
  Response.new(
380
384
  result,
381
385
  data: definition.new(data, Errors.new(errors, ["data"])),
382
386
  errors: Errors.new(errors),
383
- extensions: extensions
387
+ extensions: extensions,
388
+ full_response: execute.respond_to?("last_response") ? execute.last_response : nil
384
389
  )
385
390
  end
386
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.22.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-04-10 00:00:00.000000000 Z
11
+ date: 2024-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.57.0
131
+ version: 1.64.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.57.0
138
+ version: 1.64.1
139
139
  description: A Ruby library for declaring, composing and executing GraphQL queries
140
140
  email: engineering@github.com
141
141
  executables: []
@@ -200,7 +200,7 @@ 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.3
203
+ rubygems_version: 3.5.9
204
204
  signing_key:
205
205
  specification_version: 4
206
206
  summary: GraphQL Client