{"name":"gatsby-source-github","description":"A gatsby source plugin to source Github's GraphQL API for build-time data for Gatsby","version":"0.0.2","main":"index.js","author":{"name":"Dustin Schau","email":"dustinschau@gmail.com","url":"https://dustinschau.com"},"repository":{"type":"git","url":"https://github.com/DSchau/gatsby-source-github.git"},"license":"MIT","keywords":["gatsby","gatsby-plugin","gatsby-source-plugin"],"devDependencies":{"babel-cli":"~6.26.0","babel-plugin-transform-object-rest-spread":"~6.26.0","babel-preset-env":"~1.6.1","cross-env":"~5.1.4","husky":"~0.14.3","jest":"~22.4.3","prettier":"~1.11.1","pretty-quick":"~1.4.1"},"scripts":{"precommit":"pretty-quick --staged","build":"babel src --out-dir . --ignore __tests__","prepublishOnly":"cross-env NODE_ENV=production npm run build","test":"jest","watch":"babel -w src --out-dir . --ignore __tests__"},"dependencies":{"graphql-request":"~1.5.1","lodash":"~4.17.5","yup":"~0.24.1"},"_id":"gatsby-source-github@0.0.2","dist":{"shasum":"ea15cd5e725d60d618bba84037dcf4cb40e0e564","tarball":"http://registry-npm.ywwl.com/gatsby-source-github/download/gatsby-source-github-0.0.2.tgz","fileCount":10,"unpackedSize":8749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2W4DCRA9TVsSAnZWagAA6Y8P/izOT0n9ZmaX6le45THG\n1bWKWBalr/6TmQY/oDW2Zu87nC93Aed524qDU/ycGBnQ15wA9KrhtGrixvGv\n4vfdbmO+2i0ELkc8VZmglCMMWe/IEAopJfvdXue4crwVxXtF4NoC56j55ziZ\nVMHtgDTcfxizN5pRkV7Yhj+IZ2S1xkXk3U+E5DPUz1pQXbU6xJnb8s5IG75h\nnhJjnWUzW++soeRnt9k7uJUFzIgYd71TAKRsENFhfMjEs43AecG8QcDrMGe8\nhJJdn0Zs0QxxblrY1cd9dZ/DfgBTd+LOKRpwpk7sCfNx4rWeTV74fWQK3x2J\nusAiR8gZK7jPXbCrkBw3XZi8Los1IdXqfoBE88aRLuqPQDT77orloyQZiCrP\nqwEazjn8JyDZ0eyGv/OiX7pIHi8zQtiGUvvyrICDV4n8loACfAgUiU5ULX7p\ndOEqySht2a516OfBvYQ5kxVCShoUoOpoHbg/+bcwIT6/Rx1toxxj3/YYkrBM\ncZOeL/j1Vrltztu9WKBYzp3vOql+Hv5Jk0bEvUkb7eCPMnPoCugnV81n+FIL\nil9KTx8XPMQlc8CBc0oxazQ0AK9C3kfWLSwyRTpQKFUw6ZCzFT3uTA/9FgwF\n96q2BgWnLCKsoCmt8wQm0y4feYyCmSEdeCuj3lyOJpFJexpLTduTD0sbbXk+\n7hFD\r\n=rN52\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-AIlu6mMlO3BoI0KUUWcG5hYDl3ggEQ+RnGNWupzjeYbRh7L7/L7dYGgDBHAb8573FgVSUSZl6KX5Izl0TbK4cA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEPzjuwbVZW8/gDSNnN0bafNK60fGOp0TIq1XsMfKLbfAiAWwKIGeb8YNLk3I2wcpV1mV8omkvcZeya/9JVMWMaOjw=="}],"size":3766,"noattachment":false,"key":"/gatsby-source-github/-/gatsby-source-github-0.0.2.tgz"},"maintainers":[{"email":"dustinschau@gmail.com","name":"dschau"},{"email":"accounts@resin.io","name":"resin.io"}],"_npmUser":{"name":"dschau","email":"dustinschau@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-source-github_0.0.2_1524198914718_0.5474016174901373"},"_hasShrinkwrap":false,"deprecated":"Please use gatsby-source-graphql instead with schema stitching","readme":"# gatsby-source-github\n\n[![Build Status](https://travis-ci.org/DSchau/gatsby-source-github.svg?branch=master)](https://travis-ci.org/DSchau/gatsby-source-github)\n\nSource plugin for pulling in Github data (using its [GraphQL API][github-api]) at buildtime for static generation and further GraphQL querying with Gatsby\n\n## Install\n\n```bash\nnpm install gatsby-source-github --save-dev\n```\n\n## How to use\n\nIn your `gatsby-config.js`:\n\n```javascript\nplugins: [\n  {\n    resolve: 'gatsby-source-github',\n    options: {\n      headers: {\n        Authorization: `Bearer YOUR_GITHUB_PERSONAL_ACCESS_TOKEN`, // https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/\n      },\n      queries: [\n        `{\n          repository(owner: \"nebraskajs\", name: \"speaker-signup\") {\n            issues(last: 20, states: OPEN) {\n              edges {\n                node {\n                  id\n                  author {\n                    avatarUrl\n                    login\n                    url\n                  }\n                  bodyHTML\n                  title\n                  url\n                }\n              }\n            }\n          }\n        }`,\n      ],\n    },\n  },\n];\n```\n\n`queries` is an array of GraphQL queries. The algorithm to generate Gatsby GraphQL nodes is described [below](#the-algorithm)\n\n## How to query\n\nIn general, use the [Github API v4 documentation][github-api] and in particular, the [explorer][explorer] to craft your queries and refer to the the [below algorithm](#the-algorithm) for how to query against these results with Gatsby.\n\n### Using variables\n\nAdditionally, variables can be used/injectd into the queries. Rather than sending a string in the queries array, send an array like so:\n\n```javascript\n[\n  `query getViewer($first: Int!) {\n    viewer {\n      login\n      name\n      repositories(first:$first) {\n        edges {\n          node {\n            name\n          }\n        }\n      }\n    }\n  }`,\n  { first: 10 },\n];\n```\n\n### The algorithm\n\nThe algorithm is quite simple. It'll descend through the tree/returned structure, and if it finds an `edges` key will use the parent of that as the node name. For instance, in the above `repository` example, `githubIssue` will be the node name, and `allGithubIssues` will be the way to query against all nodes. In the `viewer` example the node name will be `githubViewer`.\n\nAll fields in the node that are queried against in the Github GraphQL query are available to be queried with Gatsby. For example, in the `repository` example above, `id`, `author` (and subfields), `bodyHTML`, etc. are available to be queried against.\n\n[github-api]: https://developer.github.com/v4/\n[explorer]: https://developer.github.com/v4/explorer/\n","publish_time":1524198914788,"_cnpm_publish_time":1524198914788,"dist-tags":{"canary":"0.0.0-alpha.c2e09d90-alpha.ac9438ae-alpha.ac9438ae","latest":"0.0.2"}}