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' )