Shopify Graphql - Failed to load schema [Nuxt 3]

Shopify Graphql - Failed to load schema [Nuxt 3]

FrancescoBuscic
Visitor
1 0 0

 

I have a problem integrating shopify on my project in nuxt 3

Hi everyone, I am trying to connect an application of mine in nuxt 3 with shopify.

I initially created an app in shopify, and set up API Admin and Storefront API Integration.

I then installed ‘nuxt-graphql-client’ on my project and configured the nuxt.config as follows:

 

 

export default defineNuxtConfig({
devtools: { enabled: true },
colorMode: {
preference: "light",
},
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},

runtimeConfig: {
public: {
"graphql-client": {
clients: {
default: {
host: process.env.SHOPIFY_DOMAIN,
token: {
name: "X-Shopify-Storefront-Access-Token",
value: process.env.SHOPIFY_STOREFRONT_TOKEN,
type: null,
},
retainToken: true,
},
},
},
},
},
css: ["~/assets/css/main.scss"],
modules: [
"@nuxt/image",
"nuxt-icon",
"nuxt-swiper",
"@nuxt/ui",
"@nuxtjs/i18n",
"nuxt-graphql-client",
],
});

 

 

I set up the .env file as follows: 

SHOPIFY_DOMAIN=https://<domain>/admin/api/2024-04/graphql.json
SHOPIFY_STOREFRONT_ACCESS_TOKEN=<token>

 

I got the token from API Credentials > Storefront API Access Token.

 

After starting the project it generated the following error: Failed to load schema from https:/<domain>//admin/api/2024-04/graphql.json:

What did I do wrong?

Replies 0 (0)