Diizzayy / nuxt-graphql-client

⚡️ Minimal GraphQL Client + Code Generation for Nuxt3
https://nuxt-graphql-client.web.app
MIT License
354 stars 44 forks source link

Warning: Could not access `graphql-client`. #501

Open michael-hillmann opened 1 month ago

michael-hillmann commented 1 month ago

Environment

Nuxt project info: - Operating System: Windows_NT

Describe the bug

I can't get rid of this warning: nuxt-graphql-warning

Expected behaviour

Startup without warning

Reproduction

My config is:

export default defineNuxtConfig({
  :
  runtimeConfig: {
    public: {
      'graphql-client': {
        clients: {
          default: {
            :
            # my host settings
          },
        },
        codegen: {
          silent: false,
        },
      },
      :
      # other public configs
    },

  },
  :
  # other server configs
})

Additional context

System is working (as far as I can see); I'm just a little unsettled by this warning.

Logs

No response

4ndre4s commented 1 month ago

I encountered the same issue.

alexardra commented 3 weeks ago

This is the line that causes the warning: https://github.com/Diizzayy/nuxt-graphql-client/blob/b512fa0670a10a24e658a108379263363892e2ac/src/runtime/plugin.ts#L16

Seems like config?.["graphql-client"] never worked on client side but with Nuxt 3.12 we now get a warning for this.

Simple check for process.server could solve this easily.