diff --git a/.changeset/deploy-publish-network.md b/.changeset/deploy-publish-network.md new file mode 100644 index 000000000..6a9874837 --- /dev/null +++ b/.changeset/deploy-publish-network.md @@ -0,0 +1,8 @@ +--- +'@graphprotocol/graph-cli': minor +--- + +Add `--publish-network` flag to `graph deploy`. When provided, its value is sent +to the deployment router as the `publish_to_graph_network` param of the +`subgraph_deploy` JSON-RPC request. When the flag is omitted, the param is left +out of the request entirely. diff --git a/packages/cli/src/commands/deploy.ts b/packages/cli/src/commands/deploy.ts index 599c80073..6d81fa0b7 100644 --- a/packages/cli/src/commands/deploy.ts +++ b/packages/cli/src/commands/deploy.ts @@ -57,6 +57,9 @@ export default class DeployCommand extends Command { summary: 'Version label used for the deployment.', char: 'l', }), + 'publish-network': Flags.string({ + summary: 'Graph network to publish the subgraph to.', + }), ipfs: Flags.string({ summary: 'Upload build results to an IPFS node.', char: 'i', @@ -98,6 +101,7 @@ export default class DeployCommand extends Command { 'deploy-key': deployKeyFlag, 'access-token': accessToken, 'version-label': versionLabelFlag, + 'publish-network': publishNetwork, ipfs, headers, node: nodeFlag, @@ -177,6 +181,7 @@ export default class DeployCommand extends Command { ipfs_hash: ipfsHash, version_label: versionLabel, debug_fork: debugFork, + publish_to_graph_network: publishNetwork, }, async ( // @ts-expect-error TODO: why are the arguments not typed?