Skip to content

Commit 53889f0

Browse files
author
Victor Velev
committed
commands: add simple --debug-fork opt for graph deploy
1 parent 62d6f93 commit 53889f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/commands/deploy.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Options:
3030
-l --version-label <label> Version label used for the deployment
3131
-h, --help Show usage information
3232
-i, --ipfs <node> Upload build results to an IPFS node (default: ${DEFAULT_IPFS_URL})
33+
--debug-fork ID of a remote subgraph whose store will be GraphQL queried
3334
-o, --output-dir <path> Output directory for build results (default: build/)
3435
--skip-migrations Skip subgraph migrations (default: false)
3536
-w, --watch Regenerate types when subgraph files change (default: false)
@@ -96,6 +97,7 @@ module.exports = {
9697
skipMigrations,
9798
w,
9899
watch,
100+
debugFork,
99101
} = toolbox.parameters.options
100102

101103
// Support both long and short option variants
@@ -189,6 +191,8 @@ module.exports = {
189191
return
190192
}
191193

194+
// TODO: validate that debugFork is a valid IPFS hash
195+
192196
let protocol
193197
try {
194198
// Checks to make sure deploy doesn't run against
@@ -264,7 +268,7 @@ module.exports = {
264268
// `Failed to deploy to Graph node ${requestUrl}`,
265269
client.request(
266270
'subgraph_deploy',
267-
{ name: subgraphName, ipfs_hash: ipfsHash, version_label: versionLabel },
271+
{ name: subgraphName, ipfs_hash: ipfsHash, version_label: versionLabel, debug_fork: debugFork },
268272
async (requestError, jsonRpcError, res) => {
269273
if (jsonRpcError) {
270274
spinner.fail(

0 commit comments

Comments
 (0)