apollo-federation 3.7.0 → 3.7.1
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/apollo-federation/entities_field.rb +16 -12
- data/lib/apollo-federation/version.rb +1 -1
- 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: f4104a6574a535d062fe70d793bfa1b3c9099adfc8a1ecc5eeed79d296f1386b
|
4
|
+
data.tar.gz: d459803bca66e82aa00dc93c86efd63740a5e5531b33b18419bb246846d10a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64ae19c9756916d3157158866f3a44cfc75644bba283aa9143237ba644c9ea2ffd6e0c91ca17dc558414a61867d04bbe8f379fee3d0a28f1f0b66298d1fb6e5d
|
7
|
+
data.tar.gz: 8c7789e315d9e68bf0c3fb1711c9a6463611bb335cfd970be5eb989a7c6ebf92c15ece86464670301e43c6978d7cb5eae3161a9841f40f0e278e0a7cba234f1f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [3.7.1](https://github.com/Gusto/apollo-federation-ruby/compare/v3.7.0...v3.7.1) (2023-06-01)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* handle lazy `resolve_references` return values ([#250](https://github.com/Gusto/apollo-federation-ruby/issues/250)) ([e29b155](https://github.com/Gusto/apollo-federation-ruby/commit/e29b15550d48093c6ed5b73dabb8206a3e9463b0))
|
7
|
+
* handle lazy `resolve_references` return values ([#250](https://github.com/Gusto/apollo-federation-ruby/issues/250)) ([1614440](https://github.com/Gusto/apollo-federation-ruby/commit/16144402d32de3d5016023b87fc2b949364761f5))
|
8
|
+
* handle lazy resolve_references return values ([#250](https://github.com/Gusto/apollo-federation-ruby/issues/250)) ([fa72465](https://github.com/Gusto/apollo-federation-ruby/commit/fa72465bd5f1d38f3556b748b905f16f932829ac))
|
9
|
+
|
1
10
|
# [3.7.0](https://github.com/Gusto/apollo-federation-ruby/compare/v3.6.9...v3.7.0) (2023-05-26)
|
2
11
|
|
3
12
|
|
@@ -34,7 +34,7 @@ module ApolloFederation
|
|
34
34
|
.with_index { |r, i| [r, i] }
|
35
35
|
.group_by { |(r, _i)| r[:__typename] }
|
36
36
|
|
37
|
-
grouped_references_with_indices.
|
37
|
+
maybe_lazies = grouped_references_with_indices.map do |typename, references_with_indices|
|
38
38
|
references = references_with_indices.map(&:first)
|
39
39
|
indices = references_with_indices.map(&:last)
|
40
40
|
|
@@ -57,21 +57,25 @@ module ApolloFederation
|
|
57
57
|
results = references
|
58
58
|
end
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
60
|
+
context.schema.after_lazy(results) do |resolved_results|
|
61
|
+
resolved_results.zip(indices).each do |result, i|
|
62
|
+
final_result[i] = context.schema.after_lazy(result) do |resolved_value|
|
63
|
+
# TODO: This isn't 100% correct: if (for some reason) 2 different resolve_reference
|
64
|
+
# calls return the same object, it might not have the right type
|
65
|
+
# Right now, apollo-federation just adds a __typename property to the result,
|
66
|
+
# but I don't really like the idea of modifying the resolved object
|
67
|
+
context[resolved_value] = type
|
68
|
+
resolved_value
|
69
|
+
end
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
|
74
|
+
# Make sure we've resolved the outer level of lazies so we can return an array with a possibly lazy
|
75
|
+
# entry for each requested entity
|
76
|
+
GraphQL::Execution::Lazy.all(maybe_lazies).then do
|
77
|
+
final_result
|
78
|
+
end
|
75
79
|
end
|
76
80
|
|
77
81
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apollo-federation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noa Elad
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: graphql
|