Skip to content

Using environment variables for apollo client httpEndpoint #495

Closed Answered by scottcarlton
scottcarlton asked this question in Q&A
Discussion options

You must be logged in to vote

Well basically just add this and was fine.
export default defineNuxtConfig({
....
apollo: {
clients: {
default: {
httpEndpoint: process.env.VITE_API_URL || 'localhost:8000/graphql'
},
},
....
vite: {
envDir: "../..",
},
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by scottcarlton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant