apollo-federation 2.2.0 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +3 -2
- data/lib/apollo-federation/entities_field.rb +12 -1
- data/lib/apollo-federation/federated_document_from_schema_definition.rb +0 -2
- data/lib/apollo-federation/has_directives.rb +0 -6
- 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: 2640264c9bd136989c737d434129afc4bdf507e1e60be0bf40a7260ee87dadee
|
4
|
+
data.tar.gz: '088b4e6b3adf2717bc778a6022069a16ab819ac40c9bc3b3d9f8773eb3c44f6a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6abd4b01d28d71e2fd943dc492ab8192cc82b17c8f4f3ede5da9b0bc18846f5b52ac6b123b55f0d3b3caaa858a2d88e7ebb427f7553b0f6d14c62141b2c3244
|
7
|
+
data.tar.gz: 65e28108093d158475d361cf4f3524b5a72ee009aa417ba0c5704c31f84be521331ec80505a325632b205c6a3bb9f43908c12e3aa28adc7c68a38fb5cdabe0f6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## [2.2.3](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.2...v2.2.3) (2022-03-22)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* **deps:** Bump minimist ([#186](https://github.com/Gusto/apollo-federation-ruby/issues/186)) ([a79cfe5](https://github.com/Gusto/apollo-federation-ruby/commit/a79cfe5ebf0a555b01446ed24abb53b11923a9b7))
|
7
|
+
|
8
|
+
## [2.2.2](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.1...v2.2.2) (2022-03-15)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* 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))
|
14
|
+
|
15
|
+
## [2.2.1](https://github.com/Gusto/apollo-federation-ruby/compare/v2.2.0...v2.2.1) (2022-03-08)
|
16
|
+
|
17
|
+
|
18
|
+
### Bug Fixes
|
19
|
+
|
20
|
+
* 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))
|
21
|
+
|
1
22
|
# [2.2.0](https://github.com/Gusto/apollo-federation-ruby/compare/v2.1.0...v2.2.0) (2022-02-04)
|
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
|
-
-
|
297
|
-
- Does not add directives to the output of `Schema.to_definition`. Since `graphql-ruby` doesn't natively support schema directives, the
|
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
|
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
|
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.
|
4
|
+
version: 2.2.3
|
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-
|
12
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: graphql
|