Create - WunderGraph

Usage

A subgraph name must be unique within a namespace.

npx wgc subgraph create [subgraphName] --label [labelName] --routing-url [url]

After creating a subgraph, you can publish it with wgc subgraph publish.

Description

The npx wgc subgraph create command allows you to create a new subgraph within the Cosmo platform. Subgraphs are isolated GraphQL schemas that can be independently deployed and managed, providing modularity and scalability to your GraphQL APIs. The [subgraphName] argument specifies the name of the new subgraph, while the --label and --routing-url options allow you to add custom metadata and define the endpoint for the subgraph’s data. Use npx wgc subgraph create -h to see all the available options.

Parameters

Options

Examples

Regular subgraph

npx wgc subgraph create products --label team=A --routing-url http://localhost:4001/graphql

Event-Driven Graph

npx wgc subgraph create events --label team=A --edg