Skip to content

Commit

Permalink
Fail publish if missing API key with Subgraph ID
Browse files Browse the repository at this point in the history
  • Loading branch information
0237h committed Nov 20, 2024
1 parent b620cd1 commit 73ce69c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/cli/src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ export default class PublishCommand extends Command {
},
} = await this.parse(PublishCommand);

if (subgraphId && !apiKey) {
ux.error('API key is required to publish to an existing subgraph (`--api-key`).\nSee https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#2-how-do-i-create-an-api-key', { exit: 1 });
}

if (ipfsHash) {
await this.publishWithBrowser({
ipfsHash,
Expand Down

0 comments on commit 73ce69c

Please sign in to comment.