Closed AJMcKane closed 3 months ago
I would also like to see how to connect the sanity.json
file so I can execute my queries right away
sanity.json
file needs to exists in the root of your project. With this content.
{
"api": {
"projectId": "{projectId}",
"dataset": "{dataset}"
}
}
Apologies for the delay on this. The plugin only supported v2 of Sanity which had a different configuration format. We have now updated the plugin to support the newer sanity.cli.js|ts config file.
@runeb When I run the query I get an error of:
Configuration must contain `projectId`
When I try and run a query now using the sanity.cli.ts file. It's using env
variables:
import {defineCliConfig} from 'sanity/cli';
const projectId = process.env.SANITY_STUDIO_PROJECT_ID;
const dataset = process.env.SANITY_STUDIO_DATASET;
export default defineCliConfig({api: {projectId, dataset}});
When I hard code them It's resolved.
Hi there,
I'm currently learning sanity and utilising it within a Nuxt.js application, so far the docs have been really helpful, but I can't get this extension to do anything. The official docs say I need a sanity.json file, but that's not the case with the Nuxt consumer, as it's configured as part of the Nuxt config, rather than in a standalone file?
And direction would be appreciated.