Create Feature Subgraph - WunderGraph

Description

Create a feature subgraph based on an existing subgraph for your federated graph within the specified (otherwise “default”) namespace. A feature subgraph is an “override” of an existing subgraph. One or more feature subgraphs are used to compose a feature flag.

Minimum Requirements

Package Minimum version
wgc 0.58.0
router 0.95.0

Usage

A feature subgraph does not function in isolation. One or more feature subgraphs must compose a feature flag, which itself must be enabled to take effect.

wgc feature-subgraph create my-feature-subgraph --subgraph my-subgraph --routing-url http://localhost:4000

The alias for feature-subgraph is fs. Note that unless specified by the --namespace parameter, the namespace will be automatically passed as “default”.

The type of the feature subgraph is determined by the type of the base subgraph. For example, if the base subgraph is a plugin subgraph, the feature subgraph will also be a plugin subgraph.

Parameters

Required Options

If the base subgraph does not exist in the specified (otherwise “default”) namespace, the command will fail.

--subgraph: The name of the existing base subgraph for which the feature subgraph is to be created.

Options

Feature subgraphs do not use labels directly; labels are set by the feature flag that the feature subgraph(s) compose.

If the base subgraph is not a plugin subgraph, the routing url is required.

Examples

wgc feature-subgraph create my-feature-subgraph \
    --subgraph my-subgraph \
    --namespace prod \
    --routing-url http://localhost:4000