> ## Documentation Index
> Fetch the complete documentation index at: https://wundergraphinc-brendan-add-sof-link.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Feature Flag

> How to update a feature flag.

## Description

Update an existing feature flag within the specified namespace (or the "default" namespace if unspecified). A feature flag is a group of one or more [feature subgraphs](/cli/feature-subgraph). Each feature subgraph represents a replacement of a specific base subgraph that composes a federated graph.

## Minimum Requirements

| Package                 | Minimum version                                                                |
| ----------------------- | ------------------------------------------------------------------------------ |
| [wgc](/cli/intro)       | [0.58.0](https://github.com/wundergraph/cosmo/compare/wgc@0.57.7...wgc@0.58.0) |
| [router](/router/intro) | [0.95.0](https://github.com/wundergraph/cosmo/releases/tag/router%400.95.0)    |

## Usage

```bash theme={null}
wgc feature-flag update my-flag --feature-subgraphs fs1 fs2
```

The alias for `feature-flag` is `ff`.

Note that unless specified by the `--namespace` parameter, the namespace will be automatically passed as "default".

<Warning>
  If either the base composition (the federated graph with the original subgraphs) or the feature flag composition fail, the router execution configuration will not be updated with the feature flag configuration.
</Warning>

## Parameters

* `<name>`: The name of the existing feature flag to update. Returns an error if the feature flag does not exist in the specified (otherwise "default") namespace.

## 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. Including this option will overwrite the existing list.

* `-n, --namespace` : The namespace of the feature flag (defaults to "default"). Returns an error if the feature flag does not exist in that namespace.

* `--label [labels...]:`The labels to apply to the feature flag. The labels are passed in the format `key=value`, and multiple values are space delimited. Including this option will overwrite the existing list.

* `--unsetlabels:` Removes all existing labels. If the `--label` parameter is also provided, it will be ignored.

* `-j, --json` : Output the information in JSON format.

## Example

Update the existing feature flag "my-flag" in the namespace "prod" with multiple feature subgraphs and the labels `team=A` and `team=B`:

```bash theme={null}
wgc feature-flag update my-flag \
    --feature-subgraphs my-graph my-other-graph \
    -n prod
    --label team=A team=B
```
