lewebsimple / nuxt3-graphql

nuxt3-graphql.vercel.app
35 stars 4 forks source link

Allow passing options in publicRuntimeConfig #7

Open idflood opened 2 years ago

idflood commented 2 years ago

On most setup the url should be configurable from environment variables. In nuxt3 it's recommended to use the publicRuntimeConfig.

Ideally we should be able to use a similar config in nuxt.config.tx:

export default defineNuxtConfig({
    ...
    publicRuntimeConfig: {
        urql: {
            url: process.env.BACKEND_URL || "https://example.com/graphql"
        },
    },
}

But with the current version this config return this: You are creating an urql-client without a url.