Apollo graphql
-
Hello,
I’m trying to use vue-apollo with composition API and in docs it says that I should add this code to root file but there isn’t one.Where exactly should I place it?
import { provide } from '@vue/composition-api' import { DefaultApolloClient } from '@vue/apollo-composable' const app = new Vue({ setup () { provide(DefaultApolloClient, apolloClient) }, render: h => h(App), })
Docs url: https://v4.apollo.vuejs.org/guide-composable/setup.html#_1-install-vue-apollo-composable
-
@nededa Try putting it in App.vue
-
Yes it worked, thanks.