0.0.2 • Published 4 years ago

react-apollo-helper v0.0.2

Weekly downloads
3
License
MIT
Repository
-
Last release
4 years ago

react-apollo-helper

react-apollo-helper is a react apollo lib to speed up the development.

Installation

Install with npm

npm install react-apollo-helper

Install with yarn

yarn add react-apollo-helper

Usage

Example

import React from 'react'
import {buildGetAll,buildAdd,buildRemove,buildUpdate,buildGetById} from 'react-apollo-helper'


export default {
  useAll: buildGetAll('articles', 'id, title'),
  useOne: buildGetById('article', 'id, title, author {id, name, photo}, images {id, url} '),
  useUpdate: buildUpdate('updateArticle', 'UpdateArticleInput', 'id'),
  useAdd: buildAdd('addArticle', 'AddArticleInput'),
  useRemove: buildRemove('removeArticle'),
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT