Skip to content

feat(cli): add --publish-network flag to graph cli deploy#2146

Draft
nasmr wants to merge 1 commit into
mainfrom
nas/deploy-publish-network
Draft

feat(cli): add --publish-network flag to graph cli deploy#2146
nasmr wants to merge 1 commit into
mainfrom
nas/deploy-publish-network

Conversation

@nasmr

@nasmr nasmr commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Adds a --publish-network flag to graph deploy. When set, its value is forwarded to Studio's deployment router as the publish_to_graph_network param of the subgraph_deploy JSON-RPC request. When the flag is omitted, the param is not included so existing deploy behavior is unchanged.

Background

To support testing of indexing agreements on arbitrum-sepolia (testnet for protocol), Studio's deployment-router needs to discern which protocol network to create the on-chain indexing agreement for once the subgraph deployment is created in Studio. Passing the flag will allow studio to identify if a subgraph deployment is targeting testnet if --publish-network arbitrum-sepolia is added to graph deploy command, while defaulting to arbitrum-one if the param is not added or passed with --publish-network arbitrum-one

Changes

  • packages/cli/src/commands/deploy.ts -- new --publish-network string flag (no default); its value is threaded into the subgraph_deploy params as publish_to_graph_network. When undefined, JSON.stringify drops the key, matching how the existing debug_fork param behaves.
  • .changeset/deploy-publish-network.md -- minor version bump.

Testing

This was tested by executing deploy command manually against local IPFS node and deployment-router, capturing the exact request body from the deployment router logs

Scenario 1: --publish-network arbitrum-sepolia -> param present
Scenario 2: flag omitted -> param absent

Also confirmed: graph deploy --help lists the flag, and pnpm build completes successfully with no error.

cli-deploy-scenario1-run cli-deploy-scenario1-log-OK cli-deploy-scenario2-run cli-deploy-scenario2-log-OK cli-deploy--help-OK

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: af497ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant