Available since Router 0.185.0
Prerequisites
To generate query plans, you will need the following:- Router executable (version 0.185.0 or later)
- Router execution configuration file
- Queries folder
- Output folder
wgc:
wgc router compose.
For detailed steps, follow the first two steps outlined here: Mastering Local Development for GraphQL Federation.
Generating query plans
In the following example, we assume the following directory structure:Report generation
The report structure changed since Router 0.189.0
-print-report option to generate a report in addition to the individual query plan files. The report will be saved in the plans folder as report.json and will follow this structure:
-print-per-file=false.
The error field on the first level will contains a value only if there is an error that is not directly related to a single plan (eg: timeout error, missing or corrupted router config).
Fail on planning error
If you want the command to exit with an error if at least one query fails to be planned, you can use the option-fail-on-error.