0.5.1 • Published 5 years ago

apollo-datasource-generic v0.5.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

apollo-datasource-generic

A generic implementaion of apollo datasource.

Install

npm install --save apollo-datasource-generic

or

yarn add apollo-datasource-generic

Usage

Define a data source by extending the GenericDataSource class.

const { fetchNewsSources, fetchNews } = require('example-news-api')

class TestDataSource extends GenericDataSource {
  constructor () {
    super('news:', 60)
  }

  getNewsSources () {
    return this.get('sources', fetchNewsSources, 60 * 60)
  }

  getNews (source) {
    return this.get(source, fetchNews)
  }
}
0.5.1

5 years ago

0.5.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago