vuejs / apollo

🚀 Apollo/GraphQL integration for VueJS
http://apollo.vuejs.org
MIT License
6.03k stars 523 forks source link

fix: use hasInjectionContext in useApolloClient before calling inject #1529

Closed DawidKopys closed 10 months ago

DawidKopys commented 10 months ago

Correct condition before calling inject() inside useApolloClient - use hasInjectionContext(). Appropriate tests were added that would fail without these changes.

It fixes https://github.com/vuejs/apollo/issues/1528 - take a look at this issue for more context.