Skip to main content

Usage

A proposal allows you to propose changes to a federated graph and review them before applying.

Description

The npx wgc proposal create command allows you to create a new proposal for federated graph changes within the Cosmo platform. Proposals provide a way to suggest and review modifications to subgraphs within a federated graph before applying them. You can include existing subgraphs with schema changes, add new subgraphs, or remove existing subgraphs in a proposal.

Parameters

  • [name]: The name of the proposal you want to create. It should be a descriptive identifier for the proposal.

Options

  • -f, --federation-graph <federatedGraphName> (required): The name of the federated graph this proposal is for.
  • -n, --namespace [namespace] : The namespace of the federated graph (Default: “default”).
  • --subgraph <subgraph>: Specify a subgraph to include in the proposal with its updated schema. Can be specified multiple times for different subgraphs.
    • Format: name:subgraph-name,schemaPath:path-to-schema
    • Example: --subgraph name:products,schemaPath:./schemas/products.graphql
  • --new-subgraph <subgraph>: Specify a new subgraph to add in the proposal. Can be specified multiple times.
    • Format: name:subgraph-name,schemaPath:path-to-schema,labels:"key=value key=value"
    • Example: --new-subgraph name:reviews,schemaPath:./schemas/reviews.graphql,labels:"team=B department=engineering"
    • The labels must match the label matchers of the federated graph the proposal is for. Otherwise the command fails, since the new subgraph would not be part of that federated graph.
  • --deleted-subgraph <name>: Specify a subgraph to be deleted in the proposal. Can be specified multiple times.
    • Example: --deleted-subgraph legacy-products
At least one of --subgraph, --new-subgraph, or --deleted-subgraph must be provided.

Examples

Update an existing subgraph

Add a new subgraph

Remove a subgraph

Complex proposal with multiple changes