[Vuejs]-How to extract value from async method and put value in apolloProvider variable?

0πŸ‘

βœ…

The extractZMockClient has implicitly a promise returned that resolves with your returned value. To get your value use

extractZMockClient().then(function(result){ 
    // create your apollo
})

result corresponds to your return in extractZMockClient

Recomendation: throw away the extract and just use

ZMockClient().then((response)=>{ 
    // dostuff
}).catch((error)=>{console.error(error)})

since you use it with await it returns a promise πŸ˜‰

-1πŸ‘

I think you are missing an await here:

const ZMockClient = async () => await import("z-mock-client")

Leave a comment