Fix

Checks for composition errors across all connected federated graphs and tries to fix them through OpenAI integration.

Usage

npx wgc subgraph fix <name> --schema <path-to-schema> --out-schema <path-to-out-schema>

Description

The npx wgc subgraph fix command checks for composition errors in all connected federated graphs associated with the specified subgraph and then tries to fix those errors. The output of the fix can be written to the file path provided.

Parameters

  • <name>: The name of the subgraph for which you want to perform the fix. This should be the exact name of the subgraph you wish to check.

Required Options

  • --schema <path-to-schema>: The path to the new schema file that you want to validate and then fix its errors. This file should contain the complete schema definition in the GraphQL Schema Definition Language (SDL) format.

Options

  • -n, --namespace : The namespace of the federated graph (Default: "default").

  • --out-schema <path-to-out-schema>: The path where the fixed schema file should be written.

Example

  1. Fix the "products" subgraph using the schema file located at "../demo/subgraphs/products/products.graphql" and write the output of the fix to a file located at "../demo/subgraphs/products/products-fix.graphql".

    npx wgc subgraph fix products --schema ../demo/subgraphs/products/products.graphql --out-schema ../demo/subgraphs/products/products-fix.graphql

Notes

  • The npx wgc subgraph fix command interacts with the Cosmo platform's control plane and connected federated graphs to perform the composition checks and then fix them.

  • The output of the fix can be written to the path provided to the --out-schema option.

Last updated