Open rebz opened 4 years ago
Tried using useLazyQuery
this morning and still have the same issue. This appears to be an issue with using functions for variables and options. So long as I don't use a function or any reactive variables it works.
Also worth mentioning that useQueryLoading
does not appear to work outside of setup()
even when using provideApolloClient
.
In your root instance, you need to provide a default Apollo Client instance v4.vue-apollo
I noticed that using the client like the docu suggests is also leading to the warning for me. But providing the Client in the main.js (there is my root) with provideApolloClient(defaultClient) works for me.
let vue = new Vue({
el: '#app',
setup() {
provideApolloClient(defaultClient)
},
router,
store,
i18n,
apolloProvider,
components: { App },
template: '<App/>'
})
is this still an issue? t least I have the same problem upgrading to Vue3 and I can't find where it comes from...
Describe the bug Using
useQuery
and attempting to enable a disabled query when used outside ofsetup()
. Looks like the ApolloClient is coming back asnull
.Logging out the following in
useApolloClient
...To Reproduce Steps to reproduce the behavior:
/packages/test-e2e-composable-vue3/src/components/NoSetupQuery.vue
<script>
tag with what you see belowno-setup-query
test.Expected behavior I expect the default ApolloClient, provided using
provideApolloClient()
, to be found byuseQuery()
and and for the query to execute once enabled.Versions vue: 2.6 w/
@vue/composition-api
plugin vue-apollo:4.0.0-alpha.12
apollo-client:3.2.2