|
1 | 1 | <img src="https://gramps-graphql.github.io/gramps-express/assets/img/gramps-banner.png" alt="GrAMPS · An easier way to manage the data sources powering your GraphQL server" width="450"> |
2 | 2 |
|
3 | | -# GrAMPS GraphQL Data Source Base |
4 | | -[](https://travis-ci.org/gramps-graphql/data-source-base) [](https://codeclimate.com/github/gramps-graphql/data-source-base/maintainability) [](https://codeclimate.com/github/gramps-graphql/data-source-base/test_coverage) [](https://www.npmjs.com/package/@gramps/data-source-base) [](https://greenkeeper.io/) |
| 3 | +# GrAMPS GraphQL Data Source for the [IMDB API](http://www.theimdbapi.org/) |
| 4 | +[](https://travis-ci.org/gramps-graphql/data-source-imdbapi) [](https://codeclimate.com/github/gramps-graphql/data-source-imdbapi/maintainability) [](https://codeclimate.com/github/gramps-graphql/data-source-imdbapi/test_coverage) [](https://www.npmjs.com/package/@gramps/data-source-imdbapi) [](https://greenkeeper.io/) |
5 | 5 |
|
6 | | -This is a minimal example and boilerplate for a GrAMPS data source. Inside, you’ll find: |
| 6 | +Look up trailers, ratings, and other information about movies from the [IMDB API](http://www.theimdbapi.org/). |
7 | 7 |
|
8 | | - - **Connector** — how to access the data source (e.g. a REST API) |
9 | | - - **Model** — methods to retrieve/modify data from the data source (e.g. a |
10 | | - CRUD wrapper) |
11 | | - - **Schema** — description for GraphQL to interpret the data (see the |
12 | | - [GraphQL docs on schemas](http://graphql.org/learn/schema/)) |
13 | | - - **Resolvers** — functions to map the results of calls to model methods to |
14 | | - the schema |
| 8 | +## Example Queries |
15 | 9 |
|
16 | | -Each file contains a `TODO` comment explaining the changes you’ll need to make to create a working data source. |
17 | | - |
18 | | -The goal of this repo is to provide enough code to allow a working example of a data source and its related tests, but to limit how much boilerplate needs to be edited to get your own data source implemented. |
19 | | - |
20 | | -## Code Quality and Continuous Integration |
21 | | - |
22 | | -To help ensure a reliable, easy-to-maintain data source, this example also includes: |
23 | | - |
24 | | - - Configuration for Travis CI (for automated testing) and Code Climate |
25 | | - (for quality analysis) |
26 | | - - Starts you off right with test coverage at 💯 |
27 | | - - Provides testing helpers for common resolver testing patterns |
28 | | - - Comes with docs! https://ibm.biz/graphql-data-source |
| 10 | +TKTK |
29 | 11 |
|
30 | 12 | ## Quickstart |
31 | 13 |
|
32 | 14 | **NOTE:** Replace all instances of `YOUR_DATA_SOURCE_NAME` with the actual name you want to use (e.g. `data-source-companyname-datatype`). |
33 | 15 |
|
34 | 16 | ```sh |
35 | 17 | # Clone the repo |
36 | | -git clone [email protected]:gramps-graphql/data-source- base.git data-source-YOUR_DATA_SOURCE_NAME |
| 18 | +git clone [email protected]:gramps-graphql/data-source- imdbapi.git data-source-YOUR_DATA_SOURCE_NAME |
37 | 19 |
|
38 | 20 | # Move into it |
39 | | -cd data-source-YOUR_DATA_SOURCE_NAME/ |
40 | | - |
41 | | -# Change the remote repo |
42 | | -git remote set-url origin [email protected]:USER_OR_ORG/YOUR_REPO_NAME.git |
43 | | - |
44 | | -# IMPORTANT: Make sure to edit the name, description, contributors, and |
45 | | -# repository fields in package.json |
| 21 | +cd data-source-imdbapi/ |
46 | 22 |
|
47 | 23 | # Install dependencies |
48 | 24 | yarn install |
|
0 commit comments