😎 Discover cool tips and tricks for customization in our next Developer Deep Dive virtual event - sign up now!

Resolving "Multiple workspaces/sources configured" error in Sanity.io version 3.

2 replies
Last updated: Mar 1, 2023
Hi everyone, please how do i resolve this
Error: Multiple workspaces/sources configured. You must define an array of GraphQL APIs in sanity/sanity.cli.ts and specify which workspace/source to use.
.
i'm trying to use multiple workspace in the version 3
Mar 1, 2023, 11:04 AM
You’ll need to define those workspaces inside of an array in you CLI config . Ex:
export default defineCliConfig({
  api: {
    projectId: "xxxxxx",
  },
  graphql: [
    {
      id: "production",
      workspace: "production",
    },
    {
      id: "dev",
      workspace: "dev",
    },
  ],
});
Mar 1, 2023, 6:36 PM
thanks 😊
Mar 1, 2023, 9:33 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?