apollo-federation 2.2.4 → 3.0.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97e0cffbe36d7e21115386a2c0cffa379b62eeff24922d1203a2abf1dbdf7059
|
4
|
+
data.tar.gz: 2220d5e08b981826d4494d98d9728a2bc4c1ef1a6aae9381f7f467204051c2c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e30f475dfa19d57e26b9374b7e6b59b33ff7125fdd57e22014448e0f7aaa741c188b7f72bde98b20953d4519fbd4fb76585a0336757123d34a95dee87e2b6044
|
7
|
+
data.tar.gz: df9e6125583486cdba492c97376d6fea8a9ff31b7fb72f2940375f53b426ec8cc3109178e9a3ca9d23f261df4dc5acc94244cbf76f1be26281ad264e4e94a075
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# [3.0.0](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.4...v3.0.0) (2022-04-05)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* camelize string fields to match sym behavior ([8f0382b](https://github.com/Gusto/apollo-federation-ruby/commit/8f0382b346d2cde5be252138275d67373b36acd7))
|
7
|
+
|
8
|
+
|
9
|
+
### BREAKING CHANGES
|
10
|
+
|
11
|
+
* string fields will be camelized by default rather than passed as is.
|
12
|
+
|
1
13
|
## [2.2.4](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.3...v2.2.4) (2022-04-01)
|
2
14
|
|
3
15
|
|
@@ -16,7 +16,10 @@ module ApolloFederation
|
|
16
16
|
name: 'requires',
|
17
17
|
arguments: [
|
18
18
|
name: 'fields',
|
19
|
-
values: ApolloFederation::FieldSetSerializer.serialize(
|
19
|
+
values: ApolloFederation::FieldSetSerializer.serialize(
|
20
|
+
requires[:fields],
|
21
|
+
camelize: requires.fetch(:camelize, true),
|
22
|
+
),
|
20
23
|
],
|
21
24
|
)
|
22
25
|
end
|
@@ -25,7 +28,10 @@ module ApolloFederation
|
|
25
28
|
name: 'provides',
|
26
29
|
arguments: [
|
27
30
|
name: 'fields',
|
28
|
-
values: ApolloFederation::FieldSetSerializer.serialize(
|
31
|
+
values: ApolloFederation::FieldSetSerializer.serialize(
|
32
|
+
provides[:fields],
|
33
|
+
camelize: provides.fetch(:camelize, true),
|
34
|
+
),
|
29
35
|
],
|
30
36
|
)
|
31
37
|
end
|
@@ -6,20 +6,18 @@ module ApolloFederation
|
|
6
6
|
module FieldSetSerializer
|
7
7
|
extend self
|
8
8
|
|
9
|
-
def serialize(fields)
|
9
|
+
def serialize(fields, camelize: true)
|
10
10
|
case fields
|
11
11
|
when Hash
|
12
12
|
fields.map do |field, nested_selections|
|
13
|
-
"#{camelize(field)} { #{serialize(nested_selections)} }"
|
13
|
+
"#{camelize(field, camelize)} { #{serialize(nested_selections, camelize: camelize)} }"
|
14
14
|
end.join(' ')
|
15
15
|
when Array
|
16
16
|
fields.map do |field|
|
17
|
-
serialize(field)
|
17
|
+
serialize(field, camelize: camelize)
|
18
18
|
end.join(' ')
|
19
|
-
when String
|
20
|
-
fields
|
21
|
-
when Symbol
|
22
|
-
camelize(fields)
|
19
|
+
when Symbol, String
|
20
|
+
camelize(fields, camelize)
|
23
21
|
else
|
24
22
|
raise ArgumentError, "Unexpected field set type: #{fields.class}"
|
25
23
|
end
|
@@ -27,8 +25,8 @@ module ApolloFederation
|
|
27
25
|
|
28
26
|
private
|
29
27
|
|
30
|
-
def camelize(field)
|
31
|
-
GraphQL::Schema::Member::BuildType.camelize(field.to_s)
|
28
|
+
def camelize(field, camelize)
|
29
|
+
camelize ? GraphQL::Schema::Member::BuildType.camelize(field.to_s) : field.to_s
|
32
30
|
end
|
33
31
|
end
|
34
32
|
end
|
@@ -18,12 +18,12 @@ module ApolloFederation
|
|
18
18
|
add_directive(name: 'extends')
|
19
19
|
end
|
20
20
|
|
21
|
-
def key(fields:)
|
21
|
+
def key(fields:, camelize: true)
|
22
22
|
add_directive(
|
23
23
|
name: 'key',
|
24
24
|
arguments: [
|
25
25
|
name: 'fields',
|
26
|
-
values: ApolloFederation::FieldSetSerializer.serialize(fields),
|
26
|
+
values: ApolloFederation::FieldSetSerializer.serialize(fields, camelize: camelize),
|
27
27
|
],
|
28
28
|
)
|
29
29
|
end
|
@@ -16,12 +16,12 @@ module ApolloFederation
|
|
16
16
|
add_directive(name: 'extends')
|
17
17
|
end
|
18
18
|
|
19
|
-
def key(fields:)
|
19
|
+
def key(fields:, camelize: true)
|
20
20
|
add_directive(
|
21
21
|
name: 'key',
|
22
22
|
arguments: [
|
23
23
|
name: 'fields',
|
24
|
-
values: ApolloFederation::FieldSetSerializer.serialize(fields),
|
24
|
+
values: ApolloFederation::FieldSetSerializer.serialize(fields, camelize: camelize),
|
25
25
|
],
|
26
26
|
)
|
27
27
|
end
|
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:
|
4
|
+
version: 3.0.0
|
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: 2022-04-
|
12
|
+
date: 2022-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: graphql
|