Configuring sanity.cli.js for multiple workspaces #3945
Answered
by
paulwhitaker
paulwhitaker
asked this question in
Sanity Studio Support
-
Error message Error: Multiple workspaces/sources configured. You must define an array of GraphQL APIs in /Users/paulw/Seorra/seorra.io/studio/sanity.cli.js and specify which workspace/source to use. Can't find the documentation on proper configuration. I've tried multiple ways to create an array array of GraphQL APIs. No joy. Can you share here or link to the docs? |
Beta Was this translation helpful? Give feedback.
Answered by
paulwhitaker
Dec 9, 2022
Replies: 2 comments
-
Found this in the types export declare interface CliConfig {
api?: CliApiConfig
project?: {
basePath?: string
}
/**
* Wraps the Studio in `<React.StrictMode>` root to aid flagging potential problems related to concurrent features (`startTransition`, `useTransition`, `useDeferredValue`, `Suspense`)
* Can also be enabled by setting `SANITY_STUDIO_REACT_STRICT_MODE="true"|"false"`.
* It only applies to `sanity dev` in dev mode, it's ignored in `sanity build` and in production.
* Defaults to `false`
*/
reactStrictMode?: boolean
server?: {
hostname?: string
port?: number
}
graphql?: GraphQLAPIConfig[]
vite?: (config: any) => any
} Working on self rescue :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Self Rescued. In case this helps anyone else in the future. import {defineCliConfig} from 'sanity/cli'
import * as dotenv from 'dotenv'
dotenv.config()
export default defineCliConfig({
api: {
projectId: 'xxxxxxx',
// dataset: 'production',
},
graphql: [
{
id: 'production',
workspace: 'Development'
},
{
id: 'template',
workspace: 'Template'
}
]
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
paulwhitaker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Self Rescued. In case this helps anyone else in the future.