Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Features
Entity cache preview: support queries with private scope (PR #4855)
This feature is part of the work on subgraph entity caching, currently in preview.
The router now supports caching responses marked with
private
scope. This caching currently works only on subgraph responses without any schema-level information.For details about the caching behavior, see PR #4855
By @Geal in #4855
Add support of custom events defined by YAML for telemetry (Issue #4320)
Users can now configure telemetry events via YAML.
to log that something has happened (e.g. a request had errors of a particular type) without reaching for Rhai or a custom plugin.
Events may be triggered on conditions and can include information in the request/response pipeline as attributes.
Here is an example of configuration:
By @bnjjj in #4956
Ability to ignore auth prefixes in the JWT plugin
The router now supports a configuration to ignore header prefixes with the JWT plugin. Given that many application headers use the format of
Authorization: <scheme> <token>
, this option enables the router to process requests for specific schemes within theAuthorization
header while ignoring others.For example, you can configure the router to process requests with
Authorization: Bearer <token>
defined while ignoring others such asAuthorization: Basic <token>
:If the header prefix is an empty string, this option is ignored.
By @lleadbet in #4718
Support conditions on custom attributes for spans and a new selector for GraphQL errors (Issue #4336)
The router now supports conditionally adding attributes on a span and the new
on_graphql_error
selector that is set to true if the response body contains GraphQL errors.An example configuration using
condition
inattributes
andon_graphql_error
:By @bnjjj in #4987
🐛 Fixes
Federation v2.7.5 (PR #5064)
This brings in a query planner fix released in v2.7.5 of Apollo Federation. Notably, from its changelog:
Fix issue with missing fragment definitions due to
generateQueryFragments
. (#2993)An incorrect implementation detail in
generateQueryFragments
caused certain queries to be missing fragment definitions, causing the operation to be invalid and fail early in the request life-cycle (before execution). Specifically, subsequent fragment "candidates" with the same type condition and the same length of selections as a previous fragment weren't correctly added to the list of fragments. An example of an affected query is:In this case, the second selection set would be converted to an inline fragment spread to subgraph fetches, but the fragment definition would be missing
By @garypen in Update the version of the router-bridge #5064
Use supergraph schema to extract authorization info (PR #5047)
The router now uses the supergraph schema to extract authorization info, as authorization information may not be available on the query planner's subgraph schemas. This reverts the authorization changes made in PR #4975.
By @tninesling in #5047
Filter fetches added to batch during batch creation (PR #5034)
Previously, the router didn't filter query hashes when creating batches. This could result in failed queries because the additional hashes could incorrectly make a query appear to be committed when it wasn't actually registered in a batch.
This release fixes this issue by filtering query hashes during batch creation.
By @garypen in #5034
Use
subgraph.name
attribute instead ofapollo.subgraph.name
(PR #5012)In the router v1.45.0, subgraph name mapping didn't work correctly in the Datadog exporter.
The Datadog exporter does some explicit mapping of attributes and was using a value
apollo.subgraph.name
that the latest versions of the router don't use. The correct choice issubgraph.name
.This release updates the mapping to reflect the change and fixes subgraph name mapping for Datadog.
By @garypen in #5012
📚 Documentation
Document traffic shaping default configuration (PR #4953)
The documentation for configuring traffic shaping has been updated to clarify that it's enabled by default with preset values. This setting has been the default since PR #3330, which landed in v1.23.0.
By @bnjjj in #4953
🧪 Experimental
Experimental type conditioned fetching (PR #4748)
This release introduces an experimental configuration to enable type-conditioned fetching.
Previously, when querying a field that was in a path of two or more unions, the query planner wasn't able to handle different selections and would aggressively collapse selections in fetches. This resulted in incorrect plans.
Enabling the
experimental_type_conditioned_fetching
option can fix this issue by configuring the query planner to fetch with type conditions.By @o0Ignition0o in #4748