@requrv/vue-apollo-async
v0.0.5
Published
Use Vue3 Apollo Query/Mutation with async callback
Downloads
10
Maintainers
Readme
Async Vue Apollo functions
The project create the async version of useQuery and useMutation on a vue based projects with Vue Apollo server.
Authors
Installation
Install with yarn:
yarn add @requrv/vue-apollo-async
Install with npm:
npm install @requrv/vue-apollo-async
Usage/Examples
import ReQurvApollo from '@requrv/vue-apollo-async'
const requrvApollo = new ReQurvApollo()
// Mutation
const { apolloMutation } = requrvApollo.useAsyncMutation({
document: MutationDocument,
options: {
variables: {
...any variables
}
}
})
const { data } = await apolloMutation() // data is the mutation result
// Query
const { apolloQuery } = requrvApollo.useAsyncQuery({
document: QueryDocument,
variables: {
...any variables
}
})
const { data } = await apolloQuery() // data is the query result