Skip to content

Instantly share code, notes, and snippets.

@joshmenden
Created September 3, 2022 01:35
Show Gist options
  • Select an option

  • Save joshmenden/247b2f3523185b6a9b49851b6365ed5a to your computer and use it in GitHub Desktop.

Select an option

Save joshmenden/247b2f3523185b6a9b49851b6365ed5a to your computer and use it in GitHub Desktop.
import { provide, createApp, h } from 'vue'
import { ApolloClients } from '@vue/apollo-composable'
import { UseApolloClients } from './src/util/useApolloClients.js'
import App from './App.vue'
// keep your URLs as env variables for easy dev/prod switching
const {
VITE_GQL_URL_1: URL1,
VITE_GQL_URL_2: URL2
} = import.meta.env
const app = createApp({
name: 'MyApp',
setup() {
provide(ApolloClients, UseApolloClients(URL1, URL2))
},
render: () => h(App),
})
// other packages you might use...
// app.use(router)
// app.use(createPinia())
app.mount('#app')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment