apollo-federation 0.5.0 → 0.5.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 +7 -0
- data/lib/apollo-federation/tracing/node_map.rb +13 -4
- data/lib/apollo-federation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c332c531c60246c58c66365271cf0cb7c20a65c21f8a3ff41920bbe4a5a5459d
|
|
4
|
+
data.tar.gz: 80ab13a30a6bbb31f5156af967e951e526afdef886fd0d3f51ebf07f0dcca731
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba2c5740717f76209899979207aa8e28c42d207cb69b770627aac702266c2501e2795efd032f7397dedff7624d076d46e10d1575eabec81b7a8a3a8b89c82047
|
|
7
|
+
data.tar.gz: 68bb01edc76d73caee59c2ae0d01e07004e783b1a881a6796758ed99b9e738fbcb8d53e80f4dee3d4c78df77d1afdb0e756e13e26d73a5cdb05e0ecb900e29fb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [0.5.1](https://github.com/Gusto/apollo-federation-ruby/compare/v0.5.0...v0.5.1) (2019-10-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* drop actionpack from runtime dependencies ([#34](https://github.com/Gusto/apollo-federation-ruby/issues/34)) ([64acd27](https://github.com/Gusto/apollo-federation-ruby/commit/64acd27))
|
|
7
|
+
|
|
1
8
|
# [0.5.0](https://github.com/Gusto/apollo-federation-ruby/compare/v0.4.2...v0.5.0) (2019-10-22)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'active_support/core_ext/array/wrap'
|
|
4
3
|
require 'apollo-federation/tracing/proto'
|
|
5
4
|
|
|
6
5
|
module ApolloFederation
|
|
@@ -28,7 +27,7 @@ module ApolloFederation
|
|
|
28
27
|
end
|
|
29
28
|
|
|
30
29
|
def node_for_path(path)
|
|
31
|
-
nodes[
|
|
30
|
+
nodes[array_wrap(path).join('.')]
|
|
32
31
|
end
|
|
33
32
|
|
|
34
33
|
def add(path)
|
|
@@ -54,10 +53,10 @@ module ApolloFederation
|
|
|
54
53
|
end
|
|
55
54
|
|
|
56
55
|
def add_error(error)
|
|
57
|
-
path =
|
|
56
|
+
path = array_wrap(error['path']).join('.')
|
|
58
57
|
node = nodes[path] || root
|
|
59
58
|
|
|
60
|
-
locations =
|
|
59
|
+
locations = array_wrap(error['locations']).map do |location|
|
|
61
60
|
ApolloFederation::Tracing::Location.new(location)
|
|
62
61
|
end
|
|
63
62
|
|
|
@@ -67,6 +66,16 @@ module ApolloFederation
|
|
|
67
66
|
json: JSON.dump(error),
|
|
68
67
|
)
|
|
69
68
|
end
|
|
69
|
+
|
|
70
|
+
def array_wrap(object)
|
|
71
|
+
if object.nil?
|
|
72
|
+
[]
|
|
73
|
+
elsif object.respond_to?(:to_ary)
|
|
74
|
+
object.to_ary || [object]
|
|
75
|
+
else
|
|
76
|
+
[object]
|
|
77
|
+
end
|
|
78
|
+
end
|
|
70
79
|
end
|
|
71
80
|
end
|
|
72
81
|
end
|