development, staging, and production. Every federated graph has a default namespace to which all graph instances are published unless otherwise specified. To specify a namespace other than the default, supply the --namespace or -n parameter when executing WunderGraph Cosmo CLI (wgc) commands.
Create Graph in default Namespace:
production Namespace:
production Namespace:
Namespaces reduce the complexity of using Labels to isolate resources in different environments.Labels and Namespaces serve complementary but distinct roles in organizing and managing resources within WunderGraph Cosmo.
- Labels allow for flexible, declarative composition of federated graphs by letting you specify which subgraphs to include when composing;
-
Namespaces are used to group and/or isolate federated graphs and subgraphs, often in different environments, such as
development,staging, andproduction.
Creating Namespaces
Create newnamespaces for your organization using the WunderGraph Cosmo CLI namespace create command. To create namespaces in your organization for production, staging, and development environments, execute the commands below.
Create Production Namespace
Namespace names must begin and end with an alphanumeric character; with the exception of dashes (-) and underscores (_), no other special characters are allowed.
Listing Namespaces
List allnamespaces for your organization using the WunderGraph Cosmo CLI namespace list command. By default, the list of namespaces in your organization will be displayed in a table. To format the output as JSON, supply the --raw or -r flag when executing the WunderGraph Cosmo CLI (wgc) namespace list command. To persist the output (as JSON) to the file system, supply the --out or -o parameter when executing the WunderGraph Cosmo CLI (wgc) namespace list command.
List Organization Namespaces
Renaming Namespaces
Already existing namespaces can be renamed. To rename an existing namespace for your organization to a new name, use the WunderGraph Cosmo CLI (wgc) namespace rename command.
Rename Existing Namespace
Deleting Namespaces
Delete anamespace for your organization using the WunderGraph Cosmo CLI namespace delete command. Note that deleting a namespace will delete all resources within it; use caution—only administrators and the creator of a namespace can perform this action. Upon executing the command, you will be prompted for confirmation that you wish to proceed. To force the execution without confirmation, supply the --force or -f flag when executing WunderGraph Cosmo CLI (wgc) namespace delete command.
Delete Namespace (Requires Confirmation)