IMPORTANT: Please note that since this command runs locally, the subgraphs may or may not exist on the control plane. It is recommended to not use this for production, if you plan to use the Cosmo platform as schema registry or analytics platform. For production, you can fetch the latest router execution config for your federated graph using the fetch command instead.
Usage
Description
Thenpx wgc router compose command allows you to compose subgraphs and build a router execution config locally without a connection to the control plane.
Options
-
-i, --input: The path to the input config file that contains information about your subgraphs. -
-o, --out: Destination file for the router config. Prints to standard output if not provided. -
--suppress-warnings: This flag suppresses any warnings produced by composition.
Input file structure
Feature flags (optional)
You can define feature flags in the input file so the composed router config includes alternate subgraphs when a flag is active. Each flag lists one or morefeature_graphs that describe the replacement subgraph to serve when the flag is enabled (e.g. via the X-Feature-Flag header). For an overview of how the router uses feature flags, see Feature Flags.
Examples
router.json
Notes
- The
npx wgc router composecommand does not interact with the control plane and completely runs locally.