Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block El-Mehdi-Abdi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
El-Mehdi-Abdi / apollo-hooks.js
Last active Oct 21, 2019
apollo useQuery hooks :: vuejs
View apollo-hooks.js
import { provide, inject, value, ref } from '@vue/composition-api';
const ApolloSymbol = Symbol()
export function provideContextToAppolo(context) {
provide(ApolloSymbol, context)
export function useApollo() {
const apollo = inject(ApolloSymbol)
return apollo.root.$apollo
You can’t perform that action at this time.