Create Feature Flag - WunderGraph

Description

Create a new feature flag within the specified namespace (or the “default” namespace if unspecified). A feature flag is a group of one or more feature subgraphs. Each feature subgraph represents a replacement of a specific base subgraph that composes a federated graph.

Minimum Requirements

Package Minimum version
wgc 0.58.0
router 0.95.0

Usage

A feature flag is disabled when created by default. To create and immediately enable a feature flag, include the --enabled flag. To enable after creation, see wgc ff enable.

wgc feature-flag create my-flag --feature-subgraphs my-graph-one my-graph-two

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

If either the base composition (the Federated Graph with the original Subgraphs) or the Feature Flag composition fail, the Router Config will not be updated with the Feature Flag configuration.

Parameters

Required Options

--fs, --feature-subgraphs: A list of names of the feature subgraphs that compose the feature flag. At least one feature subgraph name must be included, and multiple names are space delimited. Including a non-feature subgraph or a feature subgraph that does not exist in the specified (otherwise “default”) namespace will produce an error.

Options

Example

Create the feature flag “my-flag” in the namespace “prod” with multiple feature subgraphs and the labels team=A and team=B:

wgc feature-flag create my-flag \
    --feature-subgraphs my-graph my-other-graph \
    -n prod \
    --label team=A team=B