gatsby-source-github-api
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "gatsby-source-github-api", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "gatsby plugin for github v4 API", | ||
@@ -11,3 +11,4 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"lint": "eslint **.js" | ||
}, | ||
@@ -25,7 +26,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"eslint": "^4.6.1", | ||
"eslint-config-prettier": "^2.4.0", | ||
"eslint-plugin-prettier": "^2.2.0", | ||
"prettier": "^1.6.1" | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"prettier": "^1.16.4" | ||
} | ||
} |
@@ -1,11 +0,9 @@ | ||
# gatsby-source-github | ||
# gatsby-source-github-api | ||
Source plugin for pulling data into Gatsby from the official GitHub v4 [GraphQL API](https://developer.github.com/v4/). | ||
Source plugin for pulling data into Gatsby from the official Github v4 [graphQL API](https://developer.github.com/v4/). | ||
## Install | ||
`npm i gatsby-source-github-api` | ||
`npm install --save gatsby-source-github` | ||
## How to use | ||
Follow Github's guide to [generate a token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) | ||
Follow GitHub's guide [how to generate a token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). | ||
@@ -19,12 +17,11 @@ Once you are done, either create a `gatsby-config.js` file or open the one you already have. | ||
{ | ||
resolve: `gatsby-source-github`, | ||
resolve: `gatsby-source-github-api`, | ||
options: { | ||
// token required by the Github API | ||
token: someString = undefined, //required | ||
// graphQL query | ||
// defaults to a search query. See below | ||
// token: required by the GitHub API | ||
token: someString, | ||
// GraphQLquery: defaults to a search query | ||
graphQLQuery: anotherString, | ||
// graphQL variables | ||
// defaults to variables needed for a | ||
// search query. See below | ||
// variables: defaults to variables needed for a search query | ||
variables: someObject | ||
@@ -36,5 +33,5 @@ } | ||
### Examples (How to use) | ||
## Examples | ||
Simple search query | ||
**Search query:** | ||
```javascript | ||
@@ -69,3 +66,4 @@ // In your gatsby-config.js | ||
``` | ||
generic graphQL query | ||
**Custom GraphQL query:** | ||
```javascript | ||
@@ -98,4 +96,14 @@ // In your gatsby-config.js | ||
``` | ||
### Changelog | ||
v0.0.3 Initial public release | ||
For more examples see [gatsby-starter-github-portfolio](https://github.com/ldd/gatsby-starter-github-portfolio). | ||
## Tips and Tricks | ||
You'll probably want to use valid GraphQL queries. To help you, GitHub has a [Query Explorer](https://developer.github.com/v4/explorer/) with auto-completion. | ||
![Query Explorer](https://user-images.githubusercontent.com/1187476/30273078-69695a10-96c5-11e7-90b8-7dc876cc214a.png) | ||
## Changelog | ||
v0.0.4 Update dev dependencies, add linting script to package.json | ||
v0.0.3 Initial public release |
106
6193
7