❗ BREAKING ❗
Relax plugin api mutability PR #1340 PR #1289
the Plugin::*_service()
methods were taking a &mut self
as argument, but since
they work like a tower Layer, they can use &self
instead. This change
then allows us to move from Buffer to service factories for the query
planner, execution and subgraph services.
Services are now created on the fly at session creation, so if any state must be shared
between executions, it should be stored in an Arc<Mutex<_>>
in the plugin and cloned
into the new service in the Plugin::*_service()
methods.
🚀 Features
Add support to add custom resources on metrics. PR #1354
Resources are almost like attributes but more global. They are directly configured on the metrics exporter which means you'll always have these resources on each of your metrics. This functionality can be used to, for example,
apply a service.name
to metrics to make them easier to find in larger infrastructure, as demonstrated here:
telemetry:
metrics:
common:
resources:
# Set the service name to easily find metrics related to the apollo-router in your metrics dashboards
service.name: "apollo-router"
🐛 Fixes
Fix fragment on interface without typename PR #1371
When the subgraph doesn't return the __typename
and the type condition of a fragment is an interface, we should return the values if the entity implements the interface
Fix detection of an introspection query PR #1370
A query that only contains __typename
at the root will now special-cased as merely an introspection query and will bypass more complex query-planner execution (its value will just be Query
).
Accept nullable list as input PR #1363
Do not throw a validation error when you give null
for an input variable of type [Int!]
.
🛠 Maintenance
Replace Buffers of tower services with service factories (PR #1289 PR #1355)
Tower services should be used by creating a new service instance for each new session
instead of going through a Buffer
.
Execute the query plan's first response directly (PR #1357)
The query plan was previously executed in a spawned task to prepare for the @defer
implementation, but we can actually
generate the first response right inside the same future.
Remove deprecated failure
crate from the dependency tree PR #1373
This should fix automated reports about GHSA-jq66-xh47-j9f3.
Render embedded Sandbox instead of landing page (PR #1369)
Open the router URL in a browser and start querying the router from the Apollo Sandbox.
By @mayakoneval in #1369
📚 Documentation
Various documentation edits (PR #1329)
By @StephenBarlow in #1329