apollo-federation 2.1.0 → 2.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c2b2d12a9e6be8b64cbd27aa7f0188975a49398538acab0bbb2881e9919651c
4
- data.tar.gz: 614b16aed66cfdb99ee667647f020a33a537517cd4a9691e873b449b31aea57d
3
+ metadata.gz: c2c05610a6aa19695ff6a2cfc9eda7bf5ba8053f8e5ede044613962136bb3e50
4
+ data.tar.gz: efb8627e921a44420721b8da4e9d71380826f42b7aae6596a7c766daac4bda88
5
5
  SHA512:
6
- metadata.gz: 7c0f879370628f7377b1b9646536c945974e494eb6602eb0f1adbc7d9471cd69641430b682f7892da330d32ec9d5a9e984518be5c7830ee0d4ae2c8e97cc94e8
7
- data.tar.gz: bcbae55863980b44a39a8ba62d0eee3ead96052a2245a5a6c28105754b18e7c55e45deb6e04e1907fdd58bd00c6612eb9176b40ffd0ad883295076533facf084
6
+ metadata.gz: 35ed590fc3fdd628557bbe31c70140cef552f5174468cade36a61f78249d9b26a98d10062357487f9970f713d96f33ad379c77c475d355f0b51b7516a3ad5a61
7
+ data.tar.gz: 4463e67bf8a4396925fc327131757b365ede5834d29dc9836fecbd47f224b149c0c729b7c9cd6a19dbd7317cfd29ff4fdba0744aaa2829014394bec73f5bbeb7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [2.2.2](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.1...v2.2.2) (2022-03-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add a ruby version file ([#185](https://github.com/Gusto/apollo-federation-ruby/issues/185)) ([b46346b](https://github.com/Gusto/apollo-federation-ruby/commit/b46346bbbccc51d77e67ce43f411a6ee72f1a1d5))
7
+
8
+ ## [2.2.1](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.0...v2.2.1) (2022-03-08)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Remove to_graphql and make the interpreter runtime a requirement for older GraphQL versions ([#177](https://github.com/Gusto/apollo-federation-ruby/issues/177)) ([bfc3082](https://github.com/Gusto/apollo-federation-ruby/commit/bfc308260c34eee04c3b7a5f0e8a0bffe1cb88c4))
14
+
15
+ # [2.2.0](https://github.com/Gusto/apollo-federation-ruby/compare/v2.1.0...v2.2.0) (2022-02-04)
16
+
17
+
18
+ ### Features
19
+
20
+ * Get Apollo Federation to work with GraphQL 1.13.x ([#160](https://github.com/Gusto/apollo-federation-ruby/issues/160)) ([800001b](https://github.com/Gusto/apollo-federation-ruby/commit/800001baa5a54ab377998c651e7049da254c451b)), closes [#147](https://github.com/Gusto/apollo-federation-ruby/issues/147)
21
+
1
22
  # [2.1.0](https://github.com/Gusto/apollo-federation-ruby/compare/v2.0.3...v2.1.0) (2022-02-02)
2
23
 
3
24
 
data/README.md CHANGED
@@ -293,8 +293,9 @@ See discussion at [#74](https://github.com/Gusto/apollo-federation-ruby/issues/7
293
293
 
294
294
  ## Known Issues and Limitations
295
295
 
296
- - Only works with class-based schemas, the legacy `.define` API will not be supported
297
- - Does not add directives to the output of `Schema.to_definition`. Since `graphql-ruby` doesn't natively support schema directives, the directives will only be visible to the [Apollo Gateway](https://www.apollographql.com/docs/apollo-server/api/apollo-gateway/) through the `Query._service` field (see the [Apollo Federation specification](https://www.apollographql.com/docs/apollo-server/federation/federation-spec/)) or via [`Schema#federation_sdl`](https://github.com/Gusto/apollo-federation-ruby/blob/1d3baf4f8efcd02e7bf5bc7e3fee5b4fb963cd25/lib/apollo-federation/schema.rb#L19) as explained above.
296
+ - For GraphQL older than 1.12, the interpreter runtime has to be used.
297
+ - Does not add directives to the output of `Schema.to_definition`. Since `graphql-ruby` doesn't natively support schema directives, the
298
+ directives will only be visible to the [Apollo Gateway](https://www.apollographql.com/docs/apollo-server/api/apollo-gateway/) through the `Query._service` field (see the [Apollo Federation specification](https://www.apollographql.com/docs/apollo-server/federation/federation-spec/)) or via [`Schema#federation_sdl`](https://github.com/Gusto/apollo-federation-ruby/blob/1d3baf4f8efcd02e7bf5bc7e3fee5b4fb963cd25/lib/apollo-federation/schema.rb#L19) as explained above.
298
299
 
299
300
  ## Maintainers
300
301
 
@@ -38,7 +38,8 @@ module ApolloFederation
38
38
  end
39
39
 
40
40
  # TODO: What if the type is an interface?
41
- type_class = type.is_a?(GraphQL::ObjectType) ? type.metadata[:type_class] : type
41
+ type_class = class_of_type(type)
42
+
42
43
  if type_class.respond_to?(:resolve_reference)
43
44
  result = type_class.resolve_reference(reference, context)
44
45
  else
@@ -55,5 +56,15 @@ module ApolloFederation
55
56
  end
56
57
  end
57
58
  end
59
+
60
+ private
61
+
62
+ def class_of_type(type)
63
+ if defined?(GraphQL::ObjectType) && type.is_a?(GraphQL::ObjectType)
64
+ type.metadata[:type_class]
65
+ else
66
+ type
67
+ end
68
+ end
58
69
  end
59
70
  end
@@ -56,8 +56,6 @@ module ApolloFederation
56
56
  def merge_directives(node, type)
57
57
  if type.is_a?(ApolloFederation::HasDirectives)
58
58
  directives = type.federation_directives
59
- elsif type.is_a?(GraphQL::Define::InstanceDefinable)
60
- directives = type.metadata[:federation_directives]
61
59
  else
62
60
  directives = []
63
61
  end
@@ -8,11 +8,5 @@ module ApolloFederation
8
8
  @federation_directives ||= []
9
9
  @federation_directives << { name: name, arguments: arguments }
10
10
  end
11
-
12
- def to_graphql
13
- field_defn = super # Returns a GraphQL::Field
14
- field_defn.metadata[:federation_directives] = @federation_directives
15
- field_defn
16
- end
17
11
  end
18
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApolloFederation
4
- VERSION = '2.1.0'
4
+ VERSION = '2.2.2'
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.1.0
4
+ version: 2.2.2
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-02-02 00:00:00.000000000 Z
12
+ date: 2022-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphql