You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to refactor my store using vuex-module-decorators but I am facing an issue with the apollo-module of NuxtJS.
In the old store, we would use this :
@Action({commit: 'update'})asyncfetchTeacher(){// @ts-ignoreletclient=this.app.apolloProvider.defaultClient;const{ data }: {data: MeTeacherQuery}=awaitclient.query({query: MeTeacherQueryGQL});returndata.meTeacher;}
But now, I have this error
ERROR ERR_ACTION_ACCESS_UNDEFINED: Are you trying to access this.someMutation() or this.someGetter inside an @Action? 16:34:03That works only in dynamic modules.If not dynamic use this.context.commit("mutationName", payload) and this.context.getters["getterName"]Error: Could not perform action fetchTeacher at Store.<anonymous> (vuex-module-decorators\src\action.ts:55:17) at step (\vuex-module-decorators\dist\cjs\index.js:132:23) at Object.throw (vuex-module-decorators\dist\cjs\index.js:113:53) at rejected (vuex-module-decorators\dist\cjs\index.js:104:65)TypeError: Cannot read property 'apolloProvider' of undefined at Object.fetchTeacher (server.js:6339:27) at Store.<anonymous> (vuex-module-decorators\src\action.ts:34:48) at step (vuex-module-decorators\dist\cjs\index.js:132:23) at Object.next (vuex-module-decorators\dist\cjs\index.js:113:53) at vuex-module-decorators\dist\cjs\index.js:106:71 at new Promise (<anonymous>) at __awaiter (vuex-module-decorators\dist\cjs\index.js:102:12) at Store.action (vuex-module-decorators\dist\cjs\index.js:323:20) at Array.wrappedActionHandler (vuex\dist\vuex.common.js:734:23) at Store.dispatch (vuex\dist\vuex.common.js:439:15)
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to refactor my store using vuex-module-decorators but I am facing an issue with the apollo-module of NuxtJS.
In the old store, we would use this :
So I have done that in my code
But now, I have this error
The text was updated successfully, but these errors were encountered: