elasticgraph-apollo 0.18.0.1 → 0.18.0.2

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: d85c5582cff5009df1817c82726653674d045ecfd8d13a5316e881f81d080c03
4
- data.tar.gz: 18db0d78bfb86312cfc84a48949f167fc1890c41e721427c27c0823d7d899933
3
+ metadata.gz: dfd5fec5a0bdef7dfbf71553b054801edc9a5e7686bf85254ec568f788ea057e
4
+ data.tar.gz: e4a7aaf30ac783e18b5a37ef16631fab747a4f02f5c3817f7215317653366751
5
5
  SHA512:
6
- metadata.gz: 519e0fbb74e0335848bc9dacad1b5241d6b6eb5ccef1fb0745c80dfbd7ae3e95c7b5d9967d1586593eeacaacc5ba3a5faf4173de4e4a3bb4fb48794daeaeab2e
7
- data.tar.gz: 63d55b48e6a056512734832fd3fb4fb7b67edd0c622865e798b3c4854b9d569aac83d2cee5b0501e208d69f86eb2c73c8caca97884120140a31746e75bb9fa34
6
+ metadata.gz: 16e0fd760779255d136ae66a13596a42c29f22411c8680ecc379a4db88e53ba0ca0da11bbb83d716a0506b8f482eab044e27b192a1bbb8f569390efb960eca29
7
+ data.tar.gz: f009432bd23fec7e4d9e50a95c8ef70e3e54cab9d5064cdd785ab1d0a2b41b773e1140a0d69f2dbf51d5bce28ddef0ed24883aac23b70331ebf3839aa62766fa
@@ -13,7 +13,7 @@ ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, catego
13
13
 
14
14
  spec.add_dependency "elasticgraph-graphql", eg_version
15
15
  spec.add_dependency "elasticgraph-support", eg_version
16
- spec.add_dependency "graphql", ">= 2.3.7", "< 2.4"
16
+ spec.add_dependency "graphql", "~> 2.3.14"
17
17
  spec.add_dependency "apollo-federation", "~> 3.8"
18
18
 
19
19
  # Note: technically, this is not purely a development dependency, but since `eg-schema_def`
@@ -284,7 +284,7 @@ module ElasticGraph
284
284
 
285
285
  entity_types = state.object_types_by_name.values.select do |object_type|
286
286
  object_type.directives.any? do |directive|
287
- directive.name == "key" && directive.arguments[:resolvable]
287
+ directive.name == "key" && directive.arguments.fetch(:resolvable, true)
288
288
  end
289
289
  end
290
290
 
@@ -357,26 +357,40 @@ module ElasticGraph
357
357
  # @dynamic state
358
358
 
359
359
  def validate_entity_types_can_all_be_resolved(entity_types)
360
- entity_types.reject(&:indexed?).each do |object_type|
361
- key_field_names = object_type.directives
362
- .select { |dir| dir.name == "key" }
363
- # https://rubular.com/r/JEuYKzqnyR712A
364
- .flat_map { |dir| dir.arguments[:fields].to_s.gsub(/{.*}/, "").split(" ") }
365
- .to_set
366
- unresolvable_fields = object_type.graphql_fields_by_name.values.reject do |field|
367
- key_field_names.include?(field.name) ||
368
- field.relationship ||
369
- field.directives.any? { |directive| directive.name == "external" }
370
- end
371
- if unresolvable_fields.any?
372
- raise SchemaError, <<~EOS
373
- `#{object_type.name}` has fields that ElasticGraph will be unable to resolve when Apollo requests it as an entity:
374
- #{unresolvable_fields.map { |field| " * `#{field.name}`" }.join("\n")}
375
- On a non-indexed entity type like this, ElasticGraph can only resolve `@key` fields and `relates_to_(one|many)` fields.
376
- To fix this, add these fields to the `apollo_key`, redefine them as a relationship, use `field.apollo_external` so Apollo
377
- knows how to treat them, or remove them.
378
- EOS
360
+ unresolvable_field_errors =
361
+ entity_types.reject(&:indexed?).filter_map do |object_type|
362
+ key_field_names = object_type.directives
363
+ .select { |dir| dir.name == "key" }
364
+ # https://rubular.com/r/JEuYKzqnyR712A
365
+ .flat_map { |dir| dir.arguments[:fields].to_s.gsub(/{.*}/, "").split(" ") }
366
+ .to_set
367
+
368
+ unresolvable_fields = object_type.graphql_fields_by_name.values.reject do |field|
369
+ key_field_names.include?(field.name) ||
370
+ field.relationship ||
371
+ field.directives.any? { |directive| directive.name == "external" }
372
+ end
373
+
374
+ if unresolvable_fields.any?
375
+ <<~EOS.strip
376
+ `#{object_type.name}` has fields that ElasticGraph will be unable to resolve when Apollo requests it as an entity:
377
+
378
+ #{unresolvable_fields.map { |field| " * `#{field.name}`" }.join("\n")}
379
+
380
+ On a resolvable non-indexed entity type like this, ElasticGraph can only resolve `@key` fields and
381
+ `relates_to_(one|many)` fields. To fix this, either add `resolvable: false` to the `apollo_key` or
382
+ do one of the following for each unresolvable field:
383
+
384
+ * Add it to the `apollo_key`
385
+ * Redefine it as a relationship
386
+ * Use `field.apollo_external` so Apollo knows how to treat it
387
+ * Remove it
388
+ EOS
389
+ end
379
390
  end
391
+
392
+ if unresolvable_field_errors.any?
393
+ raise SchemaError, unresolvable_field_errors.join("\n#{"-" * 100}\n")
380
394
  end
381
395
  end
382
396
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticgraph-apollo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0.1
4
+ version: 0.18.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myron Marston
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-28 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop-factory_bot
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.39.0
61
+ version: 1.40.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.39.0
68
+ version: 1.40.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: steep
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -98,22 +98,22 @@ dependencies:
98
98
  name: flatware-rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 2.3.2
104
- - - "<"
103
+ version: '2.3'
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
- version: '3.0'
106
+ version: 2.3.3
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ">="
111
+ - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: 2.3.2
114
- - - "<"
113
+ version: '2.3'
114
+ - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '3.0'
116
+ version: 2.3.3
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: rspec
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -132,16 +132,16 @@ dependencies:
132
132
  name: super_diff
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ">="
135
+ - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: 0.12.1
137
+ version: '0.12'
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ">="
142
+ - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 0.12.1
144
+ version: '0.12'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: simplecov
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -160,42 +160,30 @@ dependencies:
160
160
  name: simplecov-console
161
161
  requirement: !ruby/object:Gem::Requirement
162
162
  requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: 0.9.1
166
- - - "<"
163
+ - - "~>"
167
164
  - !ruby/object:Gem::Version
168
- version: '1.0'
165
+ version: '0.9'
169
166
  type: :development
170
167
  prerelease: false
171
168
  version_requirements: !ruby/object:Gem::Requirement
172
169
  requirements:
173
- - - ">="
174
- - !ruby/object:Gem::Version
175
- version: 0.9.1
176
- - - "<"
170
+ - - "~>"
177
171
  - !ruby/object:Gem::Version
178
- version: '1.0'
172
+ version: '0.9'
179
173
  - !ruby/object:Gem::Dependency
180
174
  name: httpx
181
175
  requirement: !ruby/object:Gem::Requirement
182
176
  requirements:
183
- - - ">="
184
- - !ruby/object:Gem::Version
185
- version: 1.2.6
186
- - - "<"
177
+ - - "~>"
187
178
  - !ruby/object:Gem::Version
188
- version: '2.0'
179
+ version: '1.3'
189
180
  type: :development
190
181
  prerelease: false
191
182
  version_requirements: !ruby/object:Gem::Requirement
192
183
  requirements:
193
- - - ">="
194
- - !ruby/object:Gem::Version
195
- version: 1.2.6
196
- - - "<"
184
+ - - "~>"
197
185
  - !ruby/object:Gem::Version
198
- version: '2.0'
186
+ version: '1.3'
199
187
  - !ruby/object:Gem::Dependency
200
188
  name: method_source
201
189
  requirement: !ruby/object:Gem::Requirement
@@ -228,22 +216,22 @@ dependencies:
228
216
  name: vcr
229
217
  requirement: !ruby/object:Gem::Requirement
230
218
  requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: '6.3'
231
222
  - - ">="
232
223
  - !ruby/object:Gem::Version
233
224
  version: 6.3.1
234
- - - "<"
235
- - !ruby/object:Gem::Version
236
- version: 7.0.0
237
225
  type: :development
238
226
  prerelease: false
239
227
  version_requirements: !ruby/object:Gem::Requirement
240
228
  requirements:
229
+ - - "~>"
230
+ - !ruby/object:Gem::Version
231
+ version: '6.3'
241
232
  - - ">="
242
233
  - !ruby/object:Gem::Version
243
234
  version: 6.3.1
244
- - - "<"
245
- - !ruby/object:Gem::Version
246
- version: 7.0.0
247
235
  - !ruby/object:Gem::Dependency
248
236
  name: factory_bot
249
237
  requirement: !ruby/object:Gem::Requirement
@@ -278,48 +266,42 @@ dependencies:
278
266
  requirements:
279
267
  - - '='
280
268
  - !ruby/object:Gem::Version
281
- version: 0.18.0.1
269
+ version: 0.18.0.2
282
270
  type: :runtime
283
271
  prerelease: false
284
272
  version_requirements: !ruby/object:Gem::Requirement
285
273
  requirements:
286
274
  - - '='
287
275
  - !ruby/object:Gem::Version
288
- version: 0.18.0.1
276
+ version: 0.18.0.2
289
277
  - !ruby/object:Gem::Dependency
290
278
  name: elasticgraph-support
291
279
  requirement: !ruby/object:Gem::Requirement
292
280
  requirements:
293
281
  - - '='
294
282
  - !ruby/object:Gem::Version
295
- version: 0.18.0.1
283
+ version: 0.18.0.2
296
284
  type: :runtime
297
285
  prerelease: false
298
286
  version_requirements: !ruby/object:Gem::Requirement
299
287
  requirements:
300
288
  - - '='
301
289
  - !ruby/object:Gem::Version
302
- version: 0.18.0.1
290
+ version: 0.18.0.2
303
291
  - !ruby/object:Gem::Dependency
304
292
  name: graphql
305
293
  requirement: !ruby/object:Gem::Requirement
306
294
  requirements:
307
- - - ">="
308
- - !ruby/object:Gem::Version
309
- version: 2.3.7
310
- - - "<"
295
+ - - "~>"
311
296
  - !ruby/object:Gem::Version
312
- version: '2.4'
297
+ version: 2.3.14
313
298
  type: :runtime
314
299
  prerelease: false
315
300
  version_requirements: !ruby/object:Gem::Requirement
316
301
  requirements:
317
- - - ">="
318
- - !ruby/object:Gem::Version
319
- version: 2.3.7
320
- - - "<"
302
+ - - "~>"
321
303
  - !ruby/object:Gem::Version
322
- version: '2.4'
304
+ version: 2.3.14
323
305
  - !ruby/object:Gem::Dependency
324
306
  name: apollo-federation
325
307
  requirement: !ruby/object:Gem::Requirement
@@ -340,70 +322,70 @@ dependencies:
340
322
  requirements:
341
323
  - - '='
342
324
  - !ruby/object:Gem::Version
343
- version: 0.18.0.1
325
+ version: 0.18.0.2
344
326
  type: :development
345
327
  prerelease: false
346
328
  version_requirements: !ruby/object:Gem::Requirement
347
329
  requirements:
348
330
  - - '='
349
331
  - !ruby/object:Gem::Version
350
- version: 0.18.0.1
332
+ version: 0.18.0.2
351
333
  - !ruby/object:Gem::Dependency
352
334
  name: elasticgraph-admin
353
335
  requirement: !ruby/object:Gem::Requirement
354
336
  requirements:
355
337
  - - '='
356
338
  - !ruby/object:Gem::Version
357
- version: 0.18.0.1
339
+ version: 0.18.0.2
358
340
  type: :development
359
341
  prerelease: false
360
342
  version_requirements: !ruby/object:Gem::Requirement
361
343
  requirements:
362
344
  - - '='
363
345
  - !ruby/object:Gem::Version
364
- version: 0.18.0.1
346
+ version: 0.18.0.2
365
347
  - !ruby/object:Gem::Dependency
366
348
  name: elasticgraph-elasticsearch
367
349
  requirement: !ruby/object:Gem::Requirement
368
350
  requirements:
369
351
  - - '='
370
352
  - !ruby/object:Gem::Version
371
- version: 0.18.0.1
353
+ version: 0.18.0.2
372
354
  type: :development
373
355
  prerelease: false
374
356
  version_requirements: !ruby/object:Gem::Requirement
375
357
  requirements:
376
358
  - - '='
377
359
  - !ruby/object:Gem::Version
378
- version: 0.18.0.1
360
+ version: 0.18.0.2
379
361
  - !ruby/object:Gem::Dependency
380
362
  name: elasticgraph-opensearch
381
363
  requirement: !ruby/object:Gem::Requirement
382
364
  requirements:
383
365
  - - '='
384
366
  - !ruby/object:Gem::Version
385
- version: 0.18.0.1
367
+ version: 0.18.0.2
386
368
  type: :development
387
369
  prerelease: false
388
370
  version_requirements: !ruby/object:Gem::Requirement
389
371
  requirements:
390
372
  - - '='
391
373
  - !ruby/object:Gem::Version
392
- version: 0.18.0.1
374
+ version: 0.18.0.2
393
375
  - !ruby/object:Gem::Dependency
394
376
  name: elasticgraph-indexer
395
377
  requirement: !ruby/object:Gem::Requirement
396
378
  requirements:
397
379
  - - '='
398
380
  - !ruby/object:Gem::Version
399
- version: 0.18.0.1
381
+ version: 0.18.0.2
400
382
  type: :development
401
383
  prerelease: false
402
384
  version_requirements: !ruby/object:Gem::Requirement
403
385
  requirements:
404
386
  - - '='
405
387
  - !ruby/object:Gem::Version
406
- version: 0.18.0.1
388
+ version: 0.18.0.2
407
389
  description:
408
390
  email:
409
391
  - myron@squareup.com