Skip to content

Releases: apollographql/router

v0.9.4

14 Jun 12:59
0387f9b
Compare
Choose a tag to compare

❗ BREAKING ❗

Groundwork for @defer support (PR #1175, PR #1206)

To prepare for the implementation of the @defer directive, the ExecutionResponse and RouterResponse types now carry a stream of responses instead of a unique response. For now that stream contains only one item, so there is no change in behaviour. However, the Plugin trait changed to accomodate this, so a couple of steps are required to migrate your plugin so it is compatible with router v0.9.4:

  • Add a dependency to futures in your Cargo.toml:
+futures = "0.3.21"
  • Import BoxStream, and if your Plugin defines a router_service behavior, import ResponseBody:
+ use futures::stream::BoxStream;
+ use apollo_router::ResponseBody;
  • Update the router_service and the execution_service sections of your Plugin (if applicable):
      fn router_service(
         &mut self,
-        service: BoxService<RouterRequest, RouterResponse, BoxError>,
-    ) -> BoxService<RouterRequest, RouterResponse, BoxError> {
+        service: BoxService<RouterRequest, RouterResponse<BoxStream<'static, ResponseBody>>, BoxError>,
+    ) -> BoxService<RouterRequest, RouterResponse<BoxStream<'static, ResponseBody>>, BoxError> {

[...]

     fn execution_service(
         &mut self,
-        service: BoxService<ExecutionRequest, ExecutionResponse, BoxError>,
-    ) -> BoxService<ExecutionRequest, ExecutionResponse, BoxError> {
+        service: BoxService<ExecutionRequest, ExecutionResponse<BoxStream<'static, Response>>, BoxError>,
+    ) -> BoxService<ExecutionRequest, ExecutionResponse<BoxStream<'static, Response>>, BoxError> {

We can now update our unit tests so they work on a stream of responses instead of a single one:

         // Send a request
-        let result = test_harness.call_canned().await?;
-        if let ResponseBody::GraphQL(graphql) = result.response.body() {
+        let mut result = test_harness.call_canned().await?;
+
+        let first_response = result
+            .next_response()
+            .await
+            .expect("couldn't get primary response");
+
+        if let ResponseBody::GraphQL(graphql) = first_response {
             assert!(graphql.data.is_some());
         } else {
             panic!("expected graphql response")
         }

+        // You could keep calling result.next_response() until it yields None if you are expexting more parts.
+        assert!(result.next_response().await.is_none());
         Ok(())
     }

The apollo-router-core crate has been merged into apollo-router (PR #1189)

To upgrade, remove any dependency on the apollo-router-core crate from your Cargo.toml files and change imports like so:

- use apollo_router_core::prelude::*;
+ use apollo_router::prelude::*;

By @SimonSapin in #1189

Fix input validation rules (PR #1211)

The GraphQL specification provides two sets of coercion / validation rules, depending on whether we're dealing with inputs or outputs.
We have added validation rules for specified input validations which were not previously implemented.
This is a breaking change since slightly invalid input may have validated before but will now be guarded by newly-introduced validation rules.

By @o0Ignition0o in #1211

🚀 Features

Add trace logs for parsing recursion consumption (PR #1222)

The apollo-parser package now implements recursion limits which can be examined after the parsing phase. The router logs these
out at trace level. You can see them in your logs by searching for "recursion_limit". For example, when using JSON logging
and using jq to filter the output:

router -s ../graphql/supergraph.graphql -c ./router.yaml --log trace | jq -c '. | select(.fields.message == "recursion limit data")'
{"timestamp":"2022-06-10T15:01:02.213447Z","level":"TRACE","fields":{"message":"recursion limit data","recursion_limit":"recursion limit: 4096, high: 0"},"target":"apollo_router::spec::schema"}
{"timestamp":"2022-06-10T15:01:02.261092Z","level":"TRACE","fields":{"message":"recursion limit data","recursion_limit":"recursion limit: 4096, high: 0"},"target":"apollo_router::spec::schema"}
{"timestamp":"2022-06-10T15:01:07.642977Z","level":"TRACE","fields":{"message":"recursion limit data","recursion_limit":"recursion limit: 4096, high: 4"},"target":"apollo_router::spec::query"}

This example output shows that the maximum recursion limit is 4096 and that the query we processed caused us to recurse 4 times.

By @garypen in #1222

Helm chart now has the option to use an existing secrets for API key (PR #1196)

This change allows the use of an already existing secret for the graph API key.

To use existing secrets, update your own values.yaml file or specify the value on your helm install command line. For example:

helm install --set router.managedFederation.existingSecret="my-secret-name" <etc...>`

By @pellizzetti in #1196

Add iterators to Context (PR #1202)

Context can now be iterated over, with two new methods:

  • iter()
  • iter_mut()

These implementations lean heavily on an underlying DashMap implemetation, so refer to its documentation for more usage details.

By @garypen in #1202

Add an experimental optimization to deduplicate variables in query planner (PR #872)

Get rid of duplicated variables in requests and responses of the query planner. This optimization is disabled by default, if you want to enable it you just need override your configuration:

plugins:
  experimental.traffic_shaping:
    variables_deduplication: true # Enable the variables deduplication optimization

By @bnjjj in #872

Add more customizable metrics (PR #1159)

Added the ability to apply custom attributes/labels to metrics which are derived from header values using the Router's configuration file. For example:

telemetry:
  metrics:
    common:
      attributes:
        static:
          - name: "version"
            value: "v1.0.0"
        from_headers:
          - named: "content-type"
            rename: "payload_type"
            default: "application/json"
          - named: "x-custom-header-to-add"

By @bnjjj in #1159

Allow to set a custom health check path (PR #1164)

Added the possibility to set a custom health check path

server:
  # Default is /.well-known/apollo/server-health
  health_check_path: /health

By @jcaromiq in #1164

🐛 Fixes

Pin clap dependency in Cargo.toml (PR #1232)

A minor release of Clap occured yesterday which introduced a breaking change. This change might lead cargo scaffold users to hit a panic a runtime when the router tries to parse environment variables and arguments.

This patch pins the clap dependency to the version that was available before the release, until the root cause is found and fixed upstream.

By @o0Ignition0o in #1232

Display better error message when on subgraph fetch errors (PR #1201)

Show a helpful error message when a subgraph does not return JSON or a bad status code

By @bnjjj in #1201

Fix CORS configuration to eliminate runtime panic on misconfiguration (PR #1197)

Previously, it was possible to specify a CORS configuration which was syntactically valid, but which could not be enforced at runtime. For example, consider the following invalid configuration where the allow_any_origin and allow_credentials parameters are inherantly incompatible with each other (per the CORS specification):

server:
  cors:
    allow_any_origin: true
    allow_credentials: true

Previously, this would result in a runtime panic. The router will now detect this kind of misconfiguration and report the error without panicking.

By @garypen in #1197

🛠 Maintenance

Groundwork for @defer support (PR #1175PR #1206)

To prepare for the implementation of the @defer directive, the ExecutionResponse and RouterResponse types now carry a stream of responses instead of a unique response. For now that stream contains only one item, so there is no change in behaviour.

By @Geal in #1206

Fix a flappy test to test custom health check path (PR #1176)

Force the cre...

Read more

v0.9.3

01 Jun 09:58
dfbfea0
Compare
Choose a tag to compare

❗ BREAKING ❗

🚀 Features

Scaffold custom binary support (PR #1104)

Added CLI support for scaffolding a new Router binary project. This provides a starting point for people who want to use the Router as a library and create their own plugins

By @BrynCooke in #1104

rhai Context::upsert() supported with example (Issue #648)

Rhai plugins can now interact with Context::upsert(). We provide an example in ./examples/rhai-surrogate-cache-key to illustrate its use.

By @garypen in #1136

Measure APQ cache hits and registers (Issue #1014)

The APQ layer will now report cache hits and misses to Apollo Studio if telemetry is configured

By @Geal in #1117

Add more information to the subgraph_request span (PR #1119)

Add a new span only for the subgraph request, with all HTTP and net information needed for the OpenTelemetry specs.

By @bnjjj in #1119

🐛 Fixes

Compute default port in span information (Issue #1160)

Compute default port in span information for net.peer.port regarding the scheme of the request URI.

By @bnjjj in #1160

Response Content-Type is, again, application/json (Issue #636)

The router was not setting a content-type on client responses. This fix ensures that a content-type of application/json is set when returning a GraphQL response.

By @bnjjj in #1154

Prevent memory leaks when tasks are cancelled (PR #767)

Cancelling a request could put the router in an unresponsive state where the deduplication layer or cache would make subgraph requests hang.

By @Geal in #767

🛠 Maintenance

Use subgraphs deployed on Fly.io in CI (PR #1090)

The CI needs some Node.js subgraphs for integration tests, which complicates its setup and increases the run time. By deploying, in advance, those subgraphs on Fly.io, we can simplify the CI run.

By @Geal in #1090

Unpin schemars version (Issue #1074)

schemars v0.8.9 caused compile errors due to it validating default types. This change has, however, been rolled back upstream and we can now depend on schemars v0.8.10.

By @o0Ignition0o in #1135

Update Moka to fix occasional panics on AMD hardware (Issue #1137)

Moka has a dependency on Quanta which had an issue with AMD hardware. This is now fixed via moka-rs/moka#119

By @BrynCooke in 6b20dc85

📚 Documentation

rhai Context::upsert() supported with example (Issue #648)

Rhai documentation now illustrates how to use Context::upsert() in rhai code.

By @garypen in #1136

v0.9.2

20 May 21:12
41b8f33
Compare
Choose a tag to compare

❗ BREAKING ❗

Simplify Context::upsert() PR #1073

Removes the default parameter and requires inserted values to implement Default.

🚀 Features

DIY docker images script PR #1106

The build_docker_image.sh script shows how to build docker images from our GH release tarballs or from a commit hash/tag against the router repo.

🐛 Fixes

Return top __typename field when it's not an introspection query PR #1102

When __typename is used at the top of the query in combination with other fields it was not returned in the output.

Fix the installation and releasing script for Windows PR #1098

Do not put .exe for Windows in the name of the tarball when releasing new version

Aggregate usage reports in streaming and set the timeout to 5 seconds PR #1066

The metrics plugin was allocating chunks of usage reports to aggregate them right after, this was replaced by a streaming loop. The interval for sending the reports to spaceport was reduced from 10s to 5s.

Fix the environment variable expansion for telemetry endpoints PR #1092

Adds the ability to use environment variable expansion for the configuration of agent/collector endpoint for Jaeger, OTLP, Datadog.

Fix the introspection query detection PR #1100

Fix the introspection query detection, for example if you only have __typename in the query then it's an introspection query, if it's used with other fields (not prefixed by __) then it's not an introspection query.

🛠 Maintenance

Add well known query to PluginTestHarness PR #1114

Add call_canned on PluginTestHarness. It performs a well known query that will generate a valid response.

Remove the batching and timeout from spaceport PR #1080

Apollo Router is already handling report aggregation and sends the report every 5s. Now spaceport will put the incoming reports in a bounded queue and send them in order, with backpressure.

📚 Documentation

Add CORS documentation (PR #1044)

Updated the CORS documentation to reflect the recent CORS and CSRF updates.

v0.9.1

17 May 17:15
dc03dd5
Compare
Choose a tag to compare

❗ BREAKING ❗

Remove command line options --apollo-graph-key and --apollo-graph-ref PR #1069

Using these command line options exposes sensitive data in the process list. Setting via environment variables is now the only way that these can be set.
In addition these setting have also been removed from the telemetry configuration in yaml.

🐛 Fixes

Pin schemars version to 0.8.8 PR #1075

The Schemars 0.8.9 causes compile errors due to it validating default types. Pin the version to 0.8.8.
See issue #1074

Fix infinite recursion on during parsing PR #1078

During parsing of queries the use of " in a parameter value caused infinite recursion. This preliminary fix will be revisited shortly.

📚 Documentation

Document available metrics in Prometheus PR #1067

Add the list of metrics you can have using Prometheus

v0.9.0

13 May 15:50
aa832bf
Compare
Choose a tag to compare

🎉 The Apollo Router has graduated from Preview to General Availability (GA)! 🎉

We're so grateful for all the feedback we've received from our early Router adopters and we're excited to bring the Router to our General Availability (GA) release.

We hope you continue to report your experiences and bugs to our team as we continue to move things forward. If you're having any problems adopting the Router or finding the right migration path from Apollo Gateway which isn't already covered in our migration guide, please open an issue or discussion on this repository!

❗ BREAKING ❗

Remove the agent endpoint configuration for Zipkin PR #1025

Zipkin only supports endpoint URL configuration rather than endpoint within collector, this means Zipkin configuration changes from:

telemetry:
  tracing:
    trace_config:
      service_name: router
    zipkin:
      collector:
        endpoint: default

to:

telemetry:
  tracing:
    trace_config:
      service_name: router
    zipkin:
      endpoint: default

CSRF Protection is enabled by default PR #1006

A Cross-Site Request Forgery (CSRF) protection plugin is now enabled by default.

This means simple requests will be rejected from now on, since they represent security risks without the correct CSRF protections in place.

The plugin can be customized as explained in the CORS and CSRF example.

CORS default behavior update PR #1006

The CORS allow_headers default behavior has changed from its previous configuration.

The Router will now reflect the values received in the Access-Control-Request-Headers header, rather than only allowing Content-Type, apollographql-client-name and apollographql-client-version as it did previously.

This change loosens the CORS-related headers restrictions, so it shouldn't have any impact on your setup.

🚀 Features

CSRF Protection PR #1006

The router now embeds a CSRF protection plugin, which is enabled by default. Have a look at the CORS and CSRF example to learn how to customize it. Documentation will be updated soon!

Helm chart now supports prometheus metrics PR #1005

The router has supported exporting prometheus metrics for a while. This change updates our helm chart to enable router deployment prometheus metrics.

Configure by updating your values.yaml or by specifying the value on your helm install command line.

e.g.: helm install --set router.configuration.telemetry.metrics.prometheus.enabled=true <etc...>

Note: Prometheus metrics are not enabled by default in the helm chart.

Extend capabilities of rhai processing engine PR #1021

  • Rhai plugins can now interact more fully with responses, including body and header manipulation where available.
  • Closures are now supported for callback processing.
  • Subgraph services are now identified by name.

There is more documentation about how to use the various rhai interfaces to the Router and we now have six examples of rhai scripts (look for examples prefixed with rhai-) doing various request and response manipulations!

🐛 Fixes

Remove the requirement on jq in our install script PR #1034

We're now using cut command instead of jq which allows using our installer without installing jq first. (Don't get us wrong, we love jq, but not everyone has it installed!).

Configuration for Jaeger/Zipkin agent requires an URL instead of a socket address PR #1018

The router now supports URLs for a Jaeger or Zipkin agent allowing configuration as follows in this jaeger example:

telemetry:
  tracing:
    trace_config:
      service_name: router
    jaeger:
      agent:
        endpoint: jaeger:14268

Fix a panic in Zipkin telemetry configuration PR #1019

Using the reqwest blocking client feature was causing panicking due to an incompatible usage of an asynchronous runtime.

Improvements to Apollo Studio reporting PR #1020, PR #1037

This architectural change, which moves the location that we do aggregations internally in the Router, allows us to move towards full reporting functionality. It shouldn't affect most users.

Field usage reporting is now reported against the correct schema PR #1043

When using Managed Federation, we now report usage identified by the schema it was processed on, improving reporting in Apollo Studio.

Check that an object's __typename is part of the schema PR #1033

In case a subgraph returns an object with a __typename field referring to a type that is not in the API schema, as is the case when using the @inaccessible directive on object types, the requested object tree is now replaced with a null value in order to conform with the API schema. This improves our behavior with the recently launched Contracts feature from Apollo Studio.

🛠 Maintenance

OpenTracing examples PR #1015

We now have complete examples of OpenTracing usage with Datadog, Jaeger and Zipkin, that can be started with docker-compose.

📚 Documentation ( 📚 )

Add documentation for the endpoint configuration in server (PR #1000)

Documentation about setting a custom endpoint path for GraphQL queries has been added.

Also, we reached issue / pull-request number ONE THOUSAND! (💯0)

v0.9.0-rc.0

10 May 15:20
c11f477
Compare
Choose a tag to compare

🎉 The Apollo Router has graduated to its Release Candidate (RC) phase! 🎉

We're so grateful for all the feedback we've received from our early Router adopters and we're excited to bring things even closer to our General Availability (GA) release.

We hope you continue to report your experiences and bugs to our team as we continue to move things forward. If you're having any problems adopting the Router or finding the right migration path from Apollo Gateway which isn't already covered in our migration guide, please open an issue or discussion on this repository!

❗ BREAKING ❗

Renamed environment variables for consistency PR #990 PR #992

We've adjusted the environment variables that the Router supports to be consistently prefixed with APOLLO_ and to remove some inconsistencies in their previous naming.

You'll need to adjust to the new environment variable names, as follows:

  • RUST_LOG -> APOLLO_ROUTER_LOG
  • CONFIGURATION_PATH -> APOLLO_ROUTER_CONFIG_PATH
  • SUPERGRAPH_PATH -> APOLLO_ROUTER_SUPERGRAPH_PATH
  • ROUTER_HOT_RELOAD -> APOLLO_ROUTER_HOT_RELOAD
  • APOLLO_SCHEMA_CONFIG_DELIVERY_ENDPOINT -> APOLLO_UPLINK_ENDPOINTS
  • APOLLO_SCHEMA_POLL_INTERVAL-> APOLLO_UPLINK_POLL_INTERVAL

In addition, the following command line flags have changed:

  • --apollo-schema-config-delivery-endpoint -> --apollo-uplink-url
  • --apollo-schema-poll-interval -> --apollo-uplink-poll-interval

Configurable URL request path PR #976

The default router endpoint is now / (previously, it was /graphql). It's now possible to customize that value by defining an endpoint in your Router configuration file's server section:

server:
  # The socket address and port to listen on
  # Defaults to 127.0.0.1:4000
  listen: 127.0.0.1:4000
  # Default is /
  endpoint: /graphql

If you necessitated the previous behavior (using /graphql), you should use the above configuration.

Do even more with rhai scripts PR #971

The rhai scripting support in the Router has been re-worked to bring its capabilities closer to that native Rust plugin. This includes full participation in the service plugin lifecycle and new capabilities like logging support!

See our examples directory and the documentation for updated examples of how to use the new capabilities.

🚀 Features

Did we already mention doing more with rhai?

It's listed as a breaking change above because it is, but it's worth highlighting that it's now possible to do even more using rhai scripting which previously necessitated writing native Rust plugins and compiling your own binary.

See our examples directory and the documentation for updated examples of how to use the new capabilities.

Panics now output to the console PR #1001 PR #1004

Previously, panics would get swallowed but are now output to the console/logs. The use of the Rust-standard environment variables RUST_BACKTRACE=1 (or RUST_BACKTRACE=full) will result in emitting the full backtrace.

Apollo Studio Usage Reporting PR #898

If you have enabled telemetry in the Router, you can now see field usage reporting for your queries by heading to the Fields page for your graph in Apollo Studio.

Learn more about our field usage reporting in the Studio documentation for field usage.

PluginTestHarness PR #898

Added a simple plugin test harness that can provide canned responses to queries. This harness is early in development and the functionality and APIs will probably change.

 let mut test_harness = PluginTestHarness::builder()
            .plugin(plugin)
            .schema(Canned)
            .build()
            .await?;

let _ = test_harness
    .call(
        RouterRequest::fake_builder()
            .header("name_header", "test_client")
            .header("version_header", "1.0-test")
            .query(query)
            .and_operation_name(operation_name)
            .and_context(context)
            .build()?,
    )
    .await;

🐛 Fixes

Improve the diagnostics when encountering a configuration error PR #963

In the case of unrecognized properties in your Router's configuration, we will now point you directly to the unrecognized value. Previously, we pointed to the parent property even if it wasn't the source of the misconfiguration.

Only allow mutations on HTTP POST requests PR #975

Mutations are now only accepted when using the HTTP POST method.

Fix incorrectly omitting content of interface's fragment PR #949

The Router now distinguishes between fragments on concrete types and interfaces.
If an interface is encountered and __typename is being queried, we now check that the returned type implements the interface.

Set the service name if not specified in config or environment PR #960

The router now sets router as the default service name in OpenTelemetry traces, along with process.executable_name. This can be adjusted through the configuration file or environment variables.

Accept an endpoint URL without scheme for telemetry PR #964

Endpoint configuration for Datadog and OTLP take a URL as argument, but was incorrectly recognizing addresses of the format "host:port" (i.e., without a scheme, like grpc://) as the wrong protocol. This has been corrected!

Stricter application of @inaccessible PR #985

The Router's query planner has been updated to v2.0.2 and stricter behavior for the @inaccessible directive. This also fully supports the new Apollo Studio Contracts feature which just went generally available (GA).

Impose recursion limits on selection processing PR #995

We now limit operations to a depth of 512 to prevent cycles.

🛠 Maintenance

Use official SPDX license identifier for Elastic License v2 (ELv2) Issue #418

Rather than pointing to our LICENSE file, we now use the Elastic-2.0 SPDX license identifier to indicate that a particular component is governed by the Elastic License 2.0 (ELv2). This should facilitate automated compatibility with licensing tools which assist with compliance.

📚 Documentation

Router startup messaging now includes version and license notice PR #986

We now display the version of the Router at startup, along with clarity that the Router is licensed under ELv2.

v0.1.0-preview.7

04 May 11:10
4b5f179
Compare
Choose a tag to compare

❗ BREAKING ❗

Plugin utilities cleanup PR #819, PR #908

Utilities around creating Request and Response structures have been migrated to builders.

Migration:

  • plugin_utils::RouterRequest::builder()->RouterRequest::fake_builder()
  • plugin_utils::RouterResponse::builder()->RouterResponse::fake_builder()

In addition, the plugin_utils module has been removed. Mock service functionality has been migrated to plugin::utils::test.

Layer cleanup PR #950

Reusable layers have all been moved to apollo_router_core::layers. In particular the checkpoint_* layers have been moved from the plugins module.
async_checkpoint has been renamed to checkpoint_async for consistency with Tower.
Layers that were internal to our execution pipeline have been moved and made private to the crate.

Plugin API changes PR #855

Previously the Plugin trait has three lifecycle hooks: new, startup, and shutdown.

Startup and shutdown are problematic because:

  • Plugin construction happens in new and startup. This means creating in new and populating in startup.
  • Startup and shutdown has to be explained to the user.
  • Startup and shutdown ordering is delicate.

The lifecycle now looks like this:

  1. new
  2. activate
  3. drop

Users can migrate their plugins using the following:

  • Plugin#startup->Plugin#new
  • Plugin#shutdown->Drop#drop

In addition, the activate lifecycle hook is now not marked as deprecated, and users are free to use it.

🚀 Features

Add SpanKind and SpanStatusCode to follow the opentelemetry spec PR #925

Spans now contains otel.kind and otel.status_code attributes when needed to follow the opentelemtry spec .

Configurable client identification headers PR #850

The router uses the HTTP headers apollographql-client-name and apollographql-client-version to identify clients in Studio telemetry. Those headers can now be overriden in the configuration:

telemetry:
  apollo:
    # Header identifying the client name. defaults to apollographql-client-name
    client_name_header: <custom_client_header_name>
    # Header identifying the client version. defaults to apollographql-client-version
    client_version_header: <custom_version_header_name>

🐛 Fixes

Fields in the root selection set of a query are now correctly skipped and included PR #931

The @skip and @include directives are now executed for the fields in the root selection set.

Configuration errors on hot-reload are output PR #850

If a configuration file had errors on reload these were silently swallowed. These are now added to the logs.

Telemetry spans are no longer created for healthcheck requests PR #938

Telemetry spans where previously being created for the healthcheck requests which was creating noisy telemetry for users.

Dockerfile now allows overriding of CONFIGURATION_PATH PR #948

Previously CONFIGURATION_PATH could not be used to override the config location as it was being passed by command line arg.

Do not remove __typename from the aggregated response PR #919

If the client was explicitely requesting the __typename field, it was removed from the aggregated subgraph data, and so was not usable by fragment to check the type.

Follow the GraphQL spec about Response format PR #926

The response's data field can be null or absent depending on conventions that are now followed by the router.

🛠 Maintenance

Upgrade test-span to display more children spans in our snapshots PR #942

Previously in test-span before the fix introduced here we were filtering too aggressively. So if we wanted to snapshot all DEBUG level if we encountered a TRACE span which had DEBUG children then these children were not snapshotted. It's now fixed and it's more consistent with what we could have/see in jaeger.

Finalize migration from Warp to Axum PR #920

Adding more tests to be more confident to definitely delete the warp-server feature and get rid of warp

End to end integration tests for Jaeger PR #850

Jaeger tracing end to end test including client->router->subgraphs

Router tracing span cleanup PR #850

Spans generated by the Router are now aligned with plugin services.

Simplified CI for windows PR #850

All windows processes are spawned via xtask rather than a separate CircleCI stage.

Enable default feature in graphql_client PR #905

Removing the default feature can cause build issues in plugins.

Add client awareness headers to CORS allowed headers PR #917

The client awareness headers are now added by default to the list of CORS allowed headers, for easier integration of browser based applications. We also document how to override them and update the CORS configuration accordingly.

Remove unnecessary box in instrumentation layer PR #940

Minor simplification of code to remove boxing during instrumentation.

📚 Documentation

Enhanced rust docs (PR #819)

Many more rust docs have been added.

Federation version support page PR #896

Add Federation version support doc page detailing which versions of federation are compiled against versions of the router.

Improve readme for embedded Router PR #936

Add more details about pros and cons so that users know what they're letting themselves in for.

Document layers PR #950

Document the notable existing layers and add rust docs for custom layers including basic use cases.

v0.1.0-preview.6

21 Apr 10:47
08663ce
Compare
Choose a tag to compare

🐛 Fixes

Restore the health check route #883

Axum rework caused the healthckeck route /.well-known/apollo/server-health to change. The route is now restored.

Correctly propagate incoming POST requests #865

A regression happened during our recent switch to Axum that would propagate incoming POST requests as GET requests. Fixed and added regression tests.

HTTP routing is stricter

Previously the router was more lenient than it should have been. This has been fixed.
Before:

  • /hello -> Method not allowed (bug)
  • /graphql/hello -> Served graphql (bug)

After:

  • /hello -> 404 (correct)
  • /graphql/hello -> 404 (correct)

v0.1.0-preview.5

20 Apr 14:04
8d73a35
Compare
Choose a tag to compare

Warning!

This release has a couple of major bugs.
Please use preview.6

🚀 Features

Helm chart for the router PR #861

Helm support provided by @damienpontifex.

Line precise error reporting PR #830

The router will make a best effort to give line precise error reporting if the configuration was invalid.

1. /telemetry/tracing/trace_config/sampler

telemetry:
  tracing:
    trace_config:
      service_name: router3
      sampler: "0.3"
               ^----- "0.3" is not valid under any of the given schemas

Install experience PR #820

Added an install script that will automatically download and unzip the router into the local directory.
For more info see the quickstart documentation.

🐛 Fixes

Fix concurrent query planning #846

The query planner has been reworked to make sure concurrent plan requests will be dispatched to the relevant requester.

Do not hang when tracing provider was not set as global #849

The telemetry plugin will now Drop cleanly when the Router service stack fails to build.

Propagate error extensions originating from subgraphs PR #839

Extensions are now propagated following the configuration of the include_subgraph_error plugin.

Telemetry configuration PR #830

Jaeger and Zipkin telemetry config produced JSON schema that was invalid.

Return a better error when introspection is disabled PR #751

Instead of returning an error coming from the query planner, we are now returning a proper error explaining that the introspection has been disabled.

Add operation name to subquery fetches PR #840

If present in the query plan fetch node, the operation name will be added to sub-fetches.

Remove trailing slash from Datadog agent endpoint URL PR #863

Due to the way the endpoint URL is constructed in opentelemetry-datadog, we cannot set the agent endpoint to a URL with a trailing slash.

🛠 Maintenance

Configuration files validated PR #830

Router configuration files within the project are now largely validated via unit test.

Switch web server framework from warp to axum PR #751

The router is now running by default with an axum web server instead of warp.

Improve the way we handle Request with axum PR #845 PR #877

Take advantages of new extractors given by axum.

v0.1.0-preview.4

11 Apr 16:47
055e867
Compare
Choose a tag to compare

❗ BREAKING ❗

  • Telemetry simplification PR #782

    Telemetry configuration has been reworked to focus exporters rather than OpenTelemetry. Users can focus on what they are trying to integrate with rather than the fact that OpenTelemetry is used in the Apollo Router under the hood.

    telemetry:
      apollo:
        endpoint:
        apollo_graph_ref:
        apollo_key:
      metrics:
        prometheus:
          enabled: true
      tracing:
        propagation:
          # Propagation is automatically enabled for any exporters that are enabled,
          # but you can enable extras. This is mostly to support otlp and opentracing.
          zipkin: true
          datadog: false
          trace_context: false
          jaeger: false
          baggage: false
    
        otlp:
          endpoint: default
          protocol: grpc
          http:
            ..
          grpc:
            ..
        zipkin:
          agent:
            endpoint: default
        jaeger:
          agent:
            endpoint: default
        datadog:
          endpoint: default

🚀 Features

  • Datadog support PR #782

    Datadog support has been added via telemetry yaml configuration.

  • Yaml env variable expansion PR #782

    All values in the router configuration outside the server section may use environment variable expansion.
    Unix style expansion is used. Either:

    • ${ENV_VAR_NAME}- Expands to the environment variable ENV_VAR_NAME.
    • ${ENV_VAR_NAME:some_default} - Expands to ENV_VAR_NAME or some_default if the environment variable did not exist.

    Only values may be expanded (not keys):

    example:
      passord: "${MY_PASSWORD}" 

🐛 Fixes

  • Accept arrays in keys for subgraph joins PR #822

    The router is now accepting arrays as part of the key joining between subgraphs.

  • Fix value shape on empty subgraph queries PR #827

    When selecting data for a federated query, if there is no data the router will not perform the subgraph query and will instead return a default value. This value had the wrong shape and was generating an object where the query would expect an array.

🛠 Maintenance

  • Apollo federation 2.0.0 compatible query planning PR#828

    Now that Federation 2.0 is available, we have updated the query planner to use the latest release (@apollo/query-planner v2.0.0).