Fetch - WunderGraph

Usage

npx wgc federated-graph fetch <name>

Description

The npx wgc federated-graph fetch command allows you to download the latest valid Schema Definition Language (SDL) of a federated graph and all its subgraphs and the latest valid router config of a federated graph from the Cosmo platform’s control plane. The fetched SDL represents the unified schema of the federated graph. You can use this command to retrieve the SDL.

Parameters

Options

Apollo Compatibility

This mode will help smooth migration from the Apollo router to the WunderGraph Cosmo router. Initially, the users can use the schema registry from Cosmo and use this mode to update their routers/gateways. Later they can move from Apollo Router/Gateway to WunderGraph Router.

Output

The output of this command is stored in the structure mentioned below

If Apollo-compatibility mode is enabled, the output will contain a few more folders/files, they are as follows:-

Examples

npx wgc federated-graph fetch production

Fetches the latest valid SDL and router config of the federated graph named “production” and SDL of all its subgraphs.

npx wgc federated-graph fetch production --apollo-compatibility -v 2.6.1

Fetches the latest valid SDL and router config of the federated graph named “production” and SDL of all its subgraphs. As Apollo compatibility mode is enabled, it generates the extra files mentioned above. Using the -v option, pass the version of the federation used by the rover, if not provided it falls back to “2.5.0".