{"_id":"@aposudevsky/gatsby-source-drupal","_rev":"1-2af7181ebcf5e0087c94807ed551f235","name":"@aposudevsky/gatsby-source-drupal","dist-tags":{"latest":"3.0.26"},"versions":{"3.0.26":{"name":"@aposudevsky/gatsby-source-drupal","description":"Gatsby source plugin for building websites using the Drupal CMS as a data source. Added possibility of request customization by adding headers and get params","version":"3.0.26","author":{"name":"Andrey Posudevsky","email":"aposudevsky@gmail.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"dependencies":{"@babel/runtime":"^7.0.0","axios":"^0.18.0","bluebird":"^3.5.0","gatsby-source-filesystem":"^2.0.23","lodash":"^4.17.10"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","babel-preset-gatsby-package":"^0.1.3","cross-env":"^5.1.4"},"homepage":"https://github.com/aposudevsky/gatsby/tree/master/packages/gatsby-source-drupal#readme","keywords":["gatsby","gatsby-plugin","gatsby-source-plugin"],"license":"MIT","peerDependencies":{"gatsby":"^2.0.0"},"repository":{"type":"git","url":"https://github.com/aposudevsky/gatsby/tree/master/packages/gatsby-source-drupal"},"scripts":{"build":"babel src --out-dir . --ignore **/__tests__","prepare":"cross-env NODE_ENV=production npm run build","watch":"babel -w src --out-dir . --ignore **/__tests__"},"gitHead":"afc22bfad9e23be36b73d469f7abbb8eb5fb1e18","_id":"@aposudevsky/gatsby-source-drupal@3.0.26","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"aposudevsky","email":"aposudevsky@gmail.com"},"dist":{"integrity":"sha512-iKZZspVrykXZ1D5pGFPQ597T2Axc9tB/fIXfvcYIgqG7qYoY9yxXXhm3ofpEdf/NOyeb9L8Fk3bR2ZRfoV4JGQ==","shasum":"502ebdfe6c5756b1526e3dfa065fdc756a139b11","tarball":"https://registry.npmjs.org/@aposudevsky/gatsby-source-drupal/-/gatsby-source-drupal-3.0.26.tgz","fileCount":8,"unpackedSize":27096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd+H7CRA9TVsSAnZWagAAlaYP+gNuT1XoAlAk02grkNv6\nV4W+JchS7INOUd+NnrCnX9Tnyryt0JHHNIBt2qHOtIrkTF0HGVT0dBrCnimB\nDa2uApjE0RLoBse0Xy0EFRbFOd+yFWZkbHwZiQfC0Nx1OWk/GwIN+NIwzh0U\nD6fNsxHZ17XiuZLylmCjYqzpa79wOPi6YDQ4bS/mZscJpdxFy7N+oBrb8UOl\nVNd862U2MJE+GvcZvk8gGCT6zABq8sLBMKT262rHa9JlP3scXhN6sTpqyvuV\n7bbljQfArare+I8wUk/KtkubdynABhbUr/V2INLRtIRkwOTvupiul1iOAW8T\nY+rwfmfLy+r4+tsGs9tgK3sv12F9Mx/OrDweWA6wr+WjBcfXODPHOq9NBe2U\nYjcSxhQJ66MRIpGhEoPG4m6u9lP0qoSX+3lY1Ul6jeTGNw9hjgKYHnZsghuA\n7XNL82AMEcp4dcAdVL1mqL8shNvXvLkL288HFWmDLIHExFKA9ht05WaIwqQ+\nNU6irM0f5Uf6bmldx8HvPFU+L5kWp/3mef617d2UQB+qiauipabEJoQuRMJZ\nawOnCSyjl4VuzPN2QQRXgWSq2IW7dh1qJRNIEjctok900hlYogjaquGPiZTH\nIsGlCshCXPEzndWgToztm6f36ROC7xMgeKaOgELXfAKPwnmWjwOOFrW7LH5D\nqA4B\r\n=msLp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOHW819Z1Lan1kVyZta8y3o8R/Tm80bj9MVZnLpG8pLgIhANbdSGDkSQtDZGfvBTT9gSFpGqsNvFg6hw7FZLF1RI1C"}]},"maintainers":[{"name":"aposudevsky","email":"aposudevsky@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-source-drupal_3.0.26_1551360507250_0.37111212097682"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-28T13:28:27.011Z","3.0.26":"2019-02-28T13:28:27.417Z","modified":"2022-04-04T14:41:56.552Z"},"maintainers":[{"name":"aposudevsky","email":"aposudevsky@gmail.com"}],"description":"Gatsby source plugin for building websites using the Drupal CMS as a data source. Added possibility of request customization by adding headers and get params","homepage":"https://github.com/aposudevsky/gatsby/tree/master/packages/gatsby-source-drupal#readme","keywords":["gatsby","gatsby-plugin","gatsby-source-plugin"],"repository":{"type":"git","url":"https://github.com/aposudevsky/gatsby/tree/master/packages/gatsby-source-drupal"},"author":{"name":"Andrey Posudevsky","email":"aposudevsky@gmail.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"license":"MIT","readme":"# gatsby-source-drupal\n\nSource plugin for pulling data (including images) into Gatsby from Drupal sites.\n\nPulls data from Drupal 8 sites with the\n[Drupal JSONAPI module](https://www.drupal.org/project/jsonapi) installed.\n\nAn example site built with the headless Drupal distro\n[ContentaCMS](https://twitter.com/contentacms) is at\nhttps://using-drupal.gatsbyjs.org/\n\n`apiBase` Option allows changing the API entry point depending on the version of\njsonapi used by your Drupal instance. The default value is `jsonapi`, which has\nbeen used since jsonapi version `8.x-1.0-alpha4`.\n\n## Install\n\n`npm install --save gatsby-source-drupal`\n\n## How to use\n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-source-drupal`,\n      options: {\n        baseUrl: `https://live-contentacms.pantheonsite.io/`,\n        apiBase: `api`, // optional, defaults to `jsonapi`\n      },\n    },\n  ],\n}\n```\n\n### Basic Auth\n\nYou can use `basicAuth` option if your site is protected by basicauth.\nFirst, you need a way to pass environment variables to the build process, so secrets and other secured data aren't committed to source control. We recommend using [`dotenv`][dotenv] which will then expose environment variables. [Read more about dotenv and using environment variables here][envvars]. Then we can _use_ these environment variables and configure our plugin.\n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-source-drupal`,\n      options: {\n        baseUrl: `https://live-contentacms.pantheonsite.io/`,\n        apiBase: `api`, // optional, defaults to `jsonapi`\n        basicAuth: {\n          username: process.env.BASIC_AUTH_USERNAME,\n          password: process.env.BASIC_AUTH_PASSWORD,\n        },\n      },\n    },\n  ],\n}\n```\n\n## Request Headers \n\nYou can add optional request headers to the request using `headers` param. \n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-source-drupal`,\n      options: {\n        baseUrl: `https://live-contentacms.pantheonsite.io/`,\n        apiBase: `api`, // optional, defaults to `jsonapi`\n        headers: {\n          'Host': 'https://example.com', // any valid request header here \n        }\n      },\n    },\n  ],\n}\n```\n\n## GET Params \n\nYou can append optional GET request params to the request url using `params` option. \n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-source-drupal`,\n      options: {\n        baseUrl: `https://live-contentacms.pantheonsite.io/`,\n        apiBase: `api`, // optional, defaults to `jsonapi`\n        params: {\n          'api-key': 'your-api-key-header-here', // any valid key value pair here \n        }\n      },\n    },\n  ],\n}\n```\n\n## How to query\n\nYou can query nodes created from Drupal like the following:\n\n```graphql\n{\n  allArticle {\n    edges {\n      node {\n        title\n        internalId\n        created(formatString: \"DD-MMM-YYYY\")\n      }\n    }\n  }\n}\n```\n\n[dotenv]: https://github.com/motdotla/dotenv\n[envvars]: https://www.gatsbyjs.org/docs/environment-variables\n","readmeFilename":"README.md"}