apollo-federation 3.10.0 → 3.10.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f380edb23cd987294131a8517dc4d08331ebbbde711192baf759598c2d5ad733
|
4
|
+
data.tar.gz: ffee0d8e1d99f79ac7ba82f5f50a0d107e5b3a775ef8a9d6aff8e74f0896b221
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70e9f855c9a6284d23e69e27c85f8b4d9d85a2e93ac328a134260f3eb7328f9f3629bed1fd0acc6965d9272cadb3d7b59fbf30f1039359ddcb074074d1a0c599
|
7
|
+
data.tar.gz: 5d8bf20436400d80fa0f83f05aa37c3eb82d8525364ecc31e51b71ee16184cb5c8e3524ff236c001fd005191b5615ed38cbc2b2bb9ed10522c0892be99f6f5d8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [3.10.1](https://github.com/Gusto/apollo-federation-ruby/compare/v3.10.0...v3.10.1) (2025-04-02)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* graphql-ruby 2.3 compatibility ([#294](https://github.com/Gusto/apollo-federation-ruby/issues/294)) ([be81a67](https://github.com/Gusto/apollo-federation-ruby/commit/be81a6762d036ea4b2e92ba23c36a7b178d68e90))
|
7
|
+
|
1
8
|
# [3.10.0](https://github.com/Gusto/apollo-federation-ruby/compare/v3.9.0...v3.10.0) (2025-02-05)
|
2
9
|
|
3
10
|
|
data/README.md
CHANGED
@@ -362,7 +362,7 @@ end
|
|
362
362
|
|
363
363
|
To support [federated tracing](https://www.apollographql.com/docs/apollo-server/federation/metrics/):
|
364
364
|
|
365
|
-
1. Add `
|
365
|
+
1. Add `trace_with ApolloFederation::Tracing::Tracer` to your schema class.
|
366
366
|
2. Change your controller to add `tracing_enabled: true` to the execution context based on the presence of the "include trace" header:
|
367
367
|
```ruby
|
368
368
|
def execute
|
@@ -471,6 +471,7 @@ See discussion at [#74](https://github.com/Gusto/apollo-federation-ruby/issues/7
|
|
471
471
|
## Maintainers
|
472
472
|
|
473
473
|
Gusto GraphQL Team:
|
474
|
+
|
474
475
|
- [Sara Laupp](https://github.com/slauppy)
|
475
476
|
- [Seth Copeland](https://github.com/sethc2)
|
476
477
|
- [Simon Coffin](https://github.com/simoncoffin)
|
@@ -69,7 +69,7 @@ module ApolloFederation
|
|
69
69
|
def build_type_definition_nodes(types)
|
70
70
|
non_federation_types = types.select do |type|
|
71
71
|
if query_type?(type)
|
72
|
-
!
|
72
|
+
!fields_for_type(type).all? { |field| FEDERATION_QUERY_FIELDS.include?(field.graphql_name) }
|
73
73
|
else
|
74
74
|
!FEDERATION_TYPES.include?(type.graphql_name)
|
75
75
|
end
|
@@ -79,8 +79,23 @@ module ApolloFederation
|
|
79
79
|
|
80
80
|
private
|
81
81
|
|
82
|
+
def fields_for_type(type)
|
83
|
+
return warden.fields(type) if use_warden?
|
84
|
+
|
85
|
+
@types.fields(type)
|
86
|
+
end
|
87
|
+
|
82
88
|
def query_type?(type)
|
83
|
-
type == warden.root_type_for_operation('query')
|
89
|
+
return type == warden.root_type_for_operation('query') if use_warden?
|
90
|
+
|
91
|
+
type == @types.query_root
|
92
|
+
end
|
93
|
+
|
94
|
+
# graphql-ruby 2.3.8 removed the warden definition from a number of places:
|
95
|
+
# https://github.com/rmosolgo/graphql-ruby/compare/v2.3.7...v2.3.8#diff-e9dd0d295a58b66fabd1cf717040de5a78ade0feac6aeabae5247b5785c029ab
|
96
|
+
# The internal usage of `warden` was replaced with `types` in many cases.
|
97
|
+
def use_warden?
|
98
|
+
Gem::Version.new(GraphQL::VERSION) < Gem::Version.new('2.3.8')
|
84
99
|
end
|
85
100
|
|
86
101
|
def merge_directives(node, type)
|
@@ -40,6 +40,40 @@ module ApolloFederation
|
|
40
40
|
EXECUTE_FIELD = 'execute_field'
|
41
41
|
EXECUTE_FIELD_LAZY = 'execute_field_lazy'
|
42
42
|
|
43
|
+
def execute_multiplex(multiplex:)
|
44
|
+
ApolloFederation::Tracing::Tracer.execute_multiplex(multiplex: multiplex) { yield }
|
45
|
+
end
|
46
|
+
|
47
|
+
def execute_query_lazy(query:, multiplex:)
|
48
|
+
ApolloFederation::Tracing::Tracer.execute_query_lazy(query: query, multiplex: multiplex) { yield }
|
49
|
+
end
|
50
|
+
|
51
|
+
def execute_field(field:, query:, ast_node:, arguments:, object:)
|
52
|
+
ApolloFederation::Tracing::Tracer.execute_field(
|
53
|
+
field: field,
|
54
|
+
query: query,
|
55
|
+
ast_node: ast_node,
|
56
|
+
arguments: arguments,
|
57
|
+
object: object,
|
58
|
+
owner: field.owner,
|
59
|
+
path: query.context[:current_path],
|
60
|
+
) { yield }
|
61
|
+
end
|
62
|
+
|
63
|
+
def execute_field_lazy(field:, query:, ast_node:, arguments:, object:)
|
64
|
+
ApolloFederation::Tracing::Tracer.execute_field_lazy(
|
65
|
+
field: field,
|
66
|
+
query: query,
|
67
|
+
ast_node: ast_node,
|
68
|
+
arguments: arguments,
|
69
|
+
object: object,
|
70
|
+
owner: field.owner,
|
71
|
+
path: query.context[:current_path],
|
72
|
+
) { yield }
|
73
|
+
end
|
74
|
+
|
75
|
+
# The method below was used by older versions of graphql-ruby.
|
76
|
+
# After graphq-ruby 2.3.0 the trace modules should respond to specific methods such as `execute_field` above.
|
43
77
|
def self.trace(key, data, &block)
|
44
78
|
case key
|
45
79
|
when EXECUTE_MULTIPLEX
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apollo-federation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.10.
|
4
|
+
version: 3.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noa Elad
|
8
8
|
- Rylan Collins
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02
|
11
|
+
date: 2025-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: rack
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '2.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '2.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rackup
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|