Refactor Apollo Client handling

This commit is contained in:
Andrew Bastin
2021-05-03 09:18:24 -04:00
parent b8bc110d33
commit 627811f28d
5 changed files with 104 additions and 31 deletions

15
plugins/vue-apollo.ts Normal file
View File

@@ -0,0 +1,15 @@
import Vue from "vue"
import VueApollo from "vue-apollo"
import { apolloClient } from "~/helpers/apollo";
const vueApolloProvider = new VueApollo({
defaultClient: apolloClient as any
});
Vue.use(VueApollo);
export default (ctx: any) => {
const { app } = ctx
app.apolloProvider = vueApolloProvider
}