nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
929 stars 195 forks source link

In version 5 for Nuxt3 (NuxtJS), how can the httpEndpoint be defined in runtime? #476

Open juanmanuelcarrera opened 1 year ago

juanmanuelcarrera commented 1 year ago

Discussed in https://github.com/nuxt-modules/apollo/discussions/475

Originally posted by **juanmanuelcarrera** February 7, 2023 If I use environment variables such as process.env.API_GRAPHQL_URL to set the client's httpEndpoint value, these variables have to be defined at build time. If I don't define them at build time and I do it at runtime, the client doesn't take the value of the environment variable. Any ideas? Thanks.
juanmanuelcarrera commented 1 year ago

A trick for this defined here.