Batch Publish - WunderGraph

Usage

npx wgc subgraph batch-publish --config [configFilePath] --namespace [namespace]

Batch publish is an irreversible action. Changes become visible to the routers only after composition succeeds. Until then, the routers operate with the most recent valid composition. Use subgraph check to understand the impact of your changes first.

Description

The npx wgc subgraph batch-publish command publishes new schemas for several subgraphs in one command. List the subgraphs and their schema files in a config file, and they are published together. Use this when you update multiple subgraphs at the same time instead of running subgraph publish for each one. Every subgraph and feature subgraph listed in the config must already exist in the namespace. If any does not exist, the command fails and reports the missing names without publishing anything. Regular subgraphs and feature subgraphs go in the same subgraphs list.

Batch publish does not create subgraphs and does not publish plugin or gRPC service subgraphs. Use subgraph create to create a subgraph, subgraph publish to create and publish in one step, router plugin publish for plugins, and grpc-service publish for gRPC services.

Config file

The config file is YAML. It contains a subgraphs list, where each entry has a name and a schema file path. Schema paths are resolved relative to the config file.

subgraphs:
  - name: products
    schema: ./subgraphs/products.graphql
  - name: reviews
    schema: ./subgraphs/reviews.graphql
  # Feature subgraphs are listed here too; they are detected automatically.
  - name: products-feature
    schema: ./subgraphs/products-feature.graphql

Options

Example

npx wgc subgraph batch-publish --config ./batch-publish.yaml --namespace production

Notes