From 743244b9aee8c6f4bcaf8f98886f18eedf0409e6 Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Wed, 14 Dec 2022 11:51:05 -0800 Subject: [PATCH] fix(cli): only require workspace name if more than 1 workspace --- packages/sanity/src/_internal/cli/threads/getGraphQLAPIs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sanity/src/_internal/cli/threads/getGraphQLAPIs.ts b/packages/sanity/src/_internal/cli/threads/getGraphQLAPIs.ts index fada2c5530a..79cb545ec6d 100644 --- a/packages/sanity/src/_internal/cli/threads/getGraphQLAPIs.ts +++ b/packages/sanity/src/_internal/cli/threads/getGraphQLAPIs.ts @@ -71,7 +71,7 @@ function resolveGraphQLAPIsFromConfig( for (const apiDef of apiDefs) { const {workspace: workspaceName, source: sourceName} = apiDef - if (!workspaceName && workspaces.length > 0) { + if (!workspaceName && workspaces.length > 1) { throw new Error( 'Must define `workspace` name in GraphQL API config when multiple workspaces are defined' )