Skip to content

Configuring sanity.cli.js for multiple workspaces #3945

Discussion options

You must be logged in to vote

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

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by paulwhitaker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant