quasarframework / app-extension-apollo

The official Quasar App-Extension for Apollo and GraphQL - Currently Beta!
https://quasar.dev
109 stars 19 forks source link

this.$apollo returns `undefined` #121

Closed M-Saeb closed 1 year ago

M-Saeb commented 1 year ago

on this repo I'm trying to call this.$apollo.mutate to run a mutation from this file but all I'm getting is the error below

Uncaught TypeError: Cannot read properties of undefined (reading 'mutate')
    at Proxy.sendLoginRequest (LoginPage.vue?62cc:43:1)
    at callWithErrorHandling (runtime-core.esm-bundler.js?f781:155:1)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js?f781:164:1)
    at emit$1 (runtime-core.esm-bundler.js?f781:720:1)
    at eval (runtime-core.esm-bundler.js?f781:7292:1)
    at onClick (QBtn.js?9c40:148:1)
    at callWithErrorHandling (runtime-core.esm-bundler.js?f781:155:1)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js?f781:164:1)
    at HTMLButtonElement.invoker (runtime-dom.esm-bundler.js?9cec:369:1)

I already checked quasar.config.js, src/apollo/index.js and src/boot/apollo.js. All of them should be set properly, and Yet I still have this issue

Any help is much appreciated

smolinari commented 1 year ago

@M-Saeb - You need to be using the composable with v2.

https://v4.apollo.vuejs.org/guide-composable/mutation.html

Scott