Shopify Graphql - Failed to load schema [Nuxt 3]

Topic summary

A developer is encountering a schema loading error when integrating Shopify with a Nuxt 3 project using the ‘nuxt-graphql-client’ package.

Configuration Setup:

  • Created a Shopify app with Admin API and Storefront API integration
  • Installed ‘nuxt-graphql-client’ and configured it in nuxt.config
  • Set environment variables for Shopify domain and Storefront Access Token
  • Used the Admin API endpoint: https://<domain>/admin/api/2024-04/graphql.json

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

Key Issue:
The developer obtained the access token from API Credentials > Storefront Access Token, but is attempting to connect to the Admin API endpoint rather than the Storefront API endpoint. This mismatch between the token type (Storefront) and the API endpoint (Admin) is likely causing the schema loading failure.

Status: The issue remains unresolved with no responses yet.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

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:///admin/api/2024-04/graphql.json
SHOPIFY_STOREFRONT_ACCESS_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:///admin/api/2024-04/graphql.json:

What did I do wrong?