apollo-federation 2.2.2 → 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: c2c05610a6aa19695ff6a2cfc9eda7bf5ba8053f8e5ede044613962136bb3e50
4
- data.tar.gz: efb8627e921a44420721b8da4e9d71380826f42b7aae6596a7c766daac4bda88
3
+ metadata.gz: 97e0cffbe36d7e21115386a2c0cffa379b62eeff24922d1203a2abf1dbdf7059
4
+ data.tar.gz: 2220d5e08b981826d4494d98d9728a2bc4c1ef1a6aae9381f7f467204051c2c4
5
5
  SHA512:
6
- metadata.gz: 35ed590fc3fdd628557bbe31c70140cef552f5174468cade36a61f78249d9b26a98d10062357487f9970f713d96f33ad379c77c475d355f0b51b7516a3ad5a61
7
- data.tar.gz: 4463e67bf8a4396925fc327131757b365ede5834d29dc9836fecbd47f224b149c0c729b7c9cd6a19dbd7317cfd29ff4fdba0744aaa2829014394bec73f5bbeb7
6
+ metadata.gz: e30f475dfa19d57e26b9374b7e6b59b33ff7125fdd57e22014448e0f7aaa741c188b7f72bde98b20953d4519fbd4fb76585a0336757123d34a95dee87e2b6044
7
+ data.tar.gz: df9e6125583486cdba492c97376d6fea8a9ff31b7fb72f2940375f53b426ec8cc3109178e9a3ca9d23f261df4dc5acc94244cbf76f1be26281ad264e4e94a075
data/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
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
+
13
+ ## [2.2.4](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.3...v2.2.4) (2022-04-01)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * add linux and darwin platforms to lockfile ([#188](https://github.com/Gusto/apollo-federation-ruby/issues/188)) ([fbbb856](https://github.com/Gusto/apollo-federation-ruby/commit/fbbb856b315400f21c189c26488efbf030792ae1))
19
+ * bump circleci cache version ([#189](https://github.com/Gusto/apollo-federation-ruby/issues/189)) ([1b6c9d8](https://github.com/Gusto/apollo-federation-ruby/commit/1b6c9d8fc647c19a7eb4c95ab76b276aae9131c5))
20
+ * set env variables for release step ([#191](https://github.com/Gusto/apollo-federation-ruby/issues/191)) ([db0d1e6](https://github.com/Gusto/apollo-federation-ruby/commit/db0d1e688b93bfa2114eb91248d2f507a50fca8a))
21
+
22
+ ## [2.2.3](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.2...v2.2.3) (2022-03-22)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **deps:** Bump minimist ([#186](https://github.com/Gusto/apollo-federation-ruby/issues/186)) ([a79cfe5](https://github.com/Gusto/apollo-federation-ruby/commit/a79cfe5ebf0a555b01446ed24abb53b11923a9b7))
28
+
1
29
  ## [2.2.2](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.1...v2.2.2) (2022-03-15)
2
30
 
3
31
 
@@ -16,7 +16,10 @@ module ApolloFederation
16
16
  name: 'requires',
17
17
  arguments: [
18
18
  name: 'fields',
19
- values: ApolloFederation::FieldSetSerializer.serialize(requires[:fields]),
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(provides[:fields]),
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApolloFederation
4
- VERSION = '2.2.2'
4
+ VERSION = '3.0.0'
5
5
  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: 2.2.2
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-03-15 00:00:00.000000000 Z
12
+ date: 2022-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphql