Usage
A gRPC subgraph name must be unique within a namespace.
After creating a gRPC subgraph, you can publish it with wgc grpc-service
publish.
Description
Thewgc grpc-service create command allows you to create a new gRPC subgraph within the Cosmo platform. The <name> argument specifies the name of the new gRPC subgraph. This establishes the subgraph metadata and routing configuration without publishing any schema.
Parameters
<name>: The name of the gRPC subgraph you want to create. It is used to uniquely identify your gRPC subgraph.
Options
-
-r, --routing-url <url>: The routing URL of your subgraph. This is the URL at which the subgraph will be accessible. -
-n, --namespace [string]: The namespace of the gRPC subgraph (Default: “default”). -
--label [labels...]: Assign multiple labels to the new gRPC subgraph. Labels are used to categorize and organize subgraphs based on specific criteria (e.g., team, department, project). The labels are passed in the format<key>=<value>.- Example:
--label team=backend
- Example:
-
--readme <path-to-readme>: The path to the markdown file which describes the gRPC subgraph.
Examples
- Create a new gRPC subgraph named “users-service” with a routing URL:
- Create a new gRPC subgraph with labels:
- Create a new gRPC subgraph with a readme file:
- Create a gRPC subgraph in a specific namespace:
Notes
-
The
wgc grpc-service createcommand interacts with the Cosmo platform’s control plane to create the specified gRPC subgraph. - The routing URL must be accessible from your router instances when you later publish the subgraph schema.
- The readme file will be displayed in the Studio for documentation purposes.
-
After creating the subgraph, you’ll need to use
wgc grpc-service publishto publish your schema.