@requrv/vue-apollo-async
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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

License

MIT

Package Sidebar

Install

npm i @requrv/vue-apollo-async

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

31.5 kB

Total Files

12

Last publish

Collaborators

  • clarequrv