Cargo Features

[dependencies]
apollo-router = { version = "2.0.0-preview.1", default-features = false, features = ["global-allocator", "dhat-heap", "dhat-ad-hoc", "failfast", "docs_rs", "telemetry_next", "ci"] }
default = global-allocator

The global-allocator feature is set by default whenever apollo-router is added without default-features = false somewhere in the dependency tree.

global-allocator default

Set the Rust global allocator on some platforms https://doc.rust-lang.org/std/alloc/index.html#the-global_allocator-attribute Enabled by default. Disable default features in library crates or to set it yourself:

[dependencies]
apollo-router = {version = "1.20", default-features = false}
dhat-heap = dhat

if you are doing heap profiling

dhat-ad-hoc = dhat
failfast

Prevents the query execution to continue if any error occurs while fetching the data of a subgraph. This is useful in development as you want to be alerted early when something is wrong instead of receiving an invalid result.

docs_rs

"fake" feature to disable V8 usage when building on docs.rs See https://github.com/apollographql/federation-rs/pull/185

Enables docs_rs of router-bridge

note: this dependency should always be pinned, prefix the version with an =

telemetry_next

Enables the use of new telemetry features that are under development and not yet ready for production use.

ci

is set when ci builds take place. It allows us to disable some tests when CI is running on certain platforms.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

dhat dhat-ad-hoc? dhat-heap?