From 94daeb5c80a8fa04e9f8fd93cb875d645a13a018 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Wed, 10 Sep 2025 13:27:57 -0700 Subject: [PATCH 1/2] fix: Spec deprecation warning ``` The implicit block expectation syntax is deprecated, you should pass a block rather than an argument to `expect` to use the provided block expectation matcher or the matcher must implement `supports_value_expectations?`. e.g `expect { value }.to raise /The _entities resolver tried to load an entity for type "TypeNotInSchema"/` not `expect(value).to raise /The _entities resolver tried to load an entity for type "TypeNotInSchema"/` ``` --- spec/apollo-federation/entities_field_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/apollo-federation/entities_field_spec.rb b/spec/apollo-federation/entities_field_spec.rb index fdfe8d937..11d7602c1 100644 --- a/spec/apollo-federation/entities_field_spec.rb +++ b/spec/apollo-federation/entities_field_spec.rb @@ -223,7 +223,7 @@ def self.resolve_type(_abstract_type, _obj, _ctx) let(:typename) { 'TypeNotInSchema' } it 'raises' do - expect(-> { execute_query }).to raise_error( + expect { execute_query }.to raise_error( /The _entities resolver tried to load an entity for type "TypeNotInSchema"/, ) end From 48f2d30e1a1e88248e93bccb8c6a73392e2d3708 Mon Sep 17 00:00:00 2001 From: Chris Griego Date: Wed, 10 Sep 2025 13:33:32 -0700 Subject: [PATCH 2/2] fix: Use strict base64 encoding with ftv1 Apollo Router isn't reporting federated trace data to Apollo Studio when using `Base64.encode64`, which uses newlines, but does when using strict encoding which doesn't use newlines. --- lib/apollo-federation/tracing/tracer.rb | 2 +- spec/apollo-federation/tracing_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apollo-federation/tracing/tracer.rb b/lib/apollo-federation/tracing/tracer.rb index 386d82dbd..86aa3b3fd 100644 --- a/lib/apollo-federation/tracing/tracer.rb +++ b/lib/apollo-federation/tracing/tracer.rb @@ -224,7 +224,7 @@ def self.attach_trace_to_result(result) result[:extensions] ||= {} result[:extensions][ApolloFederation::Tracing::KEY] = - Base64.encode64(proto.class.encode(proto)) + Base64.strict_encode64(proto.class.encode(proto)) if result.context[:debug_tracing] result[:extensions][ApolloFederation::Tracing::DEBUG_KEY] = proto.to_h diff --git a/spec/apollo-federation/tracing_spec.rb b/spec/apollo-federation/tracing_spec.rb index cfa292689..b9e3ad062 100644 --- a/spec/apollo-federation/tracing_spec.rb +++ b/spec/apollo-federation/tracing_spec.rb @@ -89,7 +89,7 @@ def test def trace(query) result = schema.execute(query, context: { tracing_enabled: true }) - ApolloFederation::Tracing::Trace.decode(Base64.decode64(result[:extensions][:ftv1])) + ApolloFederation::Tracing::Trace.decode(Base64.strict_decode64(result[:extensions][:ftv1])) end describe 'building the trace tree' do