Home

Awesome

React Apollo Decorators

Better decorators for Apollo and React.

npm version js-standard-style

3 decorators that work on top of Apollo default decorator and make you code in a more declarative way.

@withGraphQL(query, options)

Use this decorator to make GraphQL query.

Differences with apollo's graphql decorator:

Usage

import withGraphQL from 'react-apollo-decorators/lib/withGraphQL'

@withMutation(mutation, options)

Use this decorator to make GraphQL mutation.

Differences with apollo's graphql decorator:

Usage

import withMutation from 'react-apollo-decorators/lib/withMutation'

@dynamicQuery(getQuery, options)

Use this decorator to make queries that change with props.

Usage

import dynamicQuery from 'react-apollo-decorators/lib/dynamicQuery'