I’ve used Dato a bunch with Nuxt 2, but tryin got use it as I upgrade to Nuxt 3. Nuxt 3 has been lacking in support for integrations, so I was wondering if you have any examples of using Nuxt 3 with Dato CMS. Currently, I am trying it by using the nuxt-graphql-client. I am getting this error:
Cannot start nuxt: Failed to load schema for “gql-sdk.ts” 09:49:51
Failed to load schema from https://graphql.datocms.com:
Could not obtain introspection result, received: {"data":[{"id":"5413bc","type":"api_error","attributes":{"code":"INVALID_AUTHORIZATION_HEADER","details":{}}}]}
Currently, I am doing this in my nuxt config:
import { defineNuxtConfig } from "nuxt";
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
ssr: false,
modules: ["@nuxtjs/tailwindcss", "nuxt-graphql-client"],
runtimeConfig: {
public: {
"graphql-client": {
clients: {
default: {
host: "https://graphql.datocms.com",
token: {
name: "DATOCMS-Read-Only-Token",
value: process.env.DATO_API_TOKEN,
type: 'Bearer',
},
retainToken: true,
},
},
},
},
},
});
My repo is public here as well: GitHub - daletom/datonuxt3
You will notice my env file is in there, it is showing my readonlytoken from Dato, so no big deal
I don’t have to use nuxt-graphql-client, open to any ideas. Or, hopefully this is just something simple I am messing up with authentication. Thanks!