Refactor Apollo Client handling
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
export default () => {
|
||||
return {
|
||||
httpEndpoint:
|
||||
process.env.CONTEXT === "production"
|
||||
? "https://api.hoppscotch.io/graphql"
|
||||
: "https://api.hoppscotch.io/graphql",
|
||||
wsEndpoint:
|
||||
process.env.CONTEXT === "production"
|
||||
? "wss://api.hoppscotch.io/graphql"
|
||||
: "wss://api.hoppscotch.io/graphql",
|
||||
}
|
||||
}
|
||||
15
plugins/vue-apollo.ts
Normal file
15
plugins/vue-apollo.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user