How to create a feature subgraph.
Package | Minimum version |
---|---|
wgc | 0.58.0 |
router | 0.95.0 |
feature-subgraph
is fs
.
Note that unless specified by the --namespace
parameter, the namespace will be automatically passed as “default”.
<name>
: The name of the feature subgraph to create. Must be unique among all subgraphs and feature subgraphs within the specified (otherwise “default”) namespace.-r , --routing-url
: Set the URL for the subgraph’s data source. This URL defines the endpoint from which the subgraph will fetch data.
--routing-url http://localhost:4001/graphql
--subgraph
: The name of the existing base subgraph for which the feature subgraph is to be created.
-n, --namespace
: The namespace of the feature subgraph (defaults to “default”). Returns an error if the feature flag does not exist in that namespace.
--subscription-url:
Use a different URL for subscription requests. If no subscription URL is provided, the router URL is used for subscriptions.
--subscription-protocol:
Set a protocol to use for subscriptions. The available options are:
ws
(default): Negotiate an appropriate protocol over websockets. Both graphql-ws
and subscription-transport-ws
are supported.
sse
: Use Server-Sent Events with a GET request.
sse_post
: Use Server-Sent events with a POST request.