{"_id":"@corygibbons/gatsby-source-shopify","_rev":"1-8416d85f04506281a688d9d1217b4953","name":"@corygibbons/gatsby-source-shopify","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@corygibbons/gatsby-source-shopify","version":"1.1.0","description":"Gatsby source plugin for building websites using Shopfiy as a data source","scripts":{"build":"babel src --out-dir .","format":"prettier --write 'src/**/*.js' README.md","prepublish":"npm run build","watch":"npm run build -- --watch"},"homepage":"https://github.com/angeloashmore/gatsby-source-shopify","repository":{"type":"git","url":"git+https://github.com/angeloashmore/gatsby-source-shopify.git"},"keywords":["gatsby","gatsby-plugin","gatsby-source-plugin","shopify"],"author":{"name":"Angelo Ashmore"},"license":"MIT","devDependencies":{"babel-cli":"^6.26.0","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.7.0","prettier":"^1.13.0"},"dependencies":{"chalk":"^2.4.1","gatsby-node-helpers":"^0.3.0","gatsby-source-filesystem":"^1.5.36","graphql-request":"^1.6.0","lodash":"^4.17.4","p-iteration":"^1.1.7","prettyjson":"^1.2.1"},"gitHead":"a54e643d67299e420d9bc59034c0a4cac246ccb8","bugs":{"url":"https://github.com/angeloashmore/gatsby-source-shopify/issues"},"_id":"@corygibbons/gatsby-source-shopify@1.1.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"corygibbons","email":"hello@corygibbons.com"},"dist":{"integrity":"sha512-IsGv8ryprRauu9W6nQVQrrO7JqQx1HQ2hi7RB7GQbjuge9sIvW+MIRZlTuaRtM8d2Tc+PfuFE8mO5Uh80Eodug==","shasum":"e291efc1bfc7dca50ad03c2920384ac6a08a5b51","tarball":"https://registry.npmjs.org/@corygibbons/gatsby-source-shopify/-/gatsby-source-shopify-1.1.0.tgz","fileCount":9,"unpackedSize":46527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMG+JCRA9TVsSAnZWagAAid0P/j9O7Bp9tyOXTkfhOtcB\ni1XiVLv3BPrAFMX4rTia3Hz9qFt817gxcLhFSW60C3uUr0zd9gEFc6AdpTR7\npAU7t491CkqB/vvzyw/Szer2Chnuwx8I2u9+c3pb4sMHjAcTC8D1wE6fOnoe\nBMWrCRz/RRUAwm8p08b8xYTrSRdSAQf6XR3gJR05ZTuf4TxhGVZNlJWd3bow\nrkKpFmDfDu9kAf6qbzvG4FvfNpQdJ9OAWxhKN6Fk6CAVmd82Q8+tXIHkJfNH\nrT+8YyM/1MYVC6Eyv70/4ZrYibvJgEOxef5RdNYUaNVDpaC0xzI7zneG/LGE\n0PZ02H0W5RN3Ju9To6n05vs9FeFiQJ89bmDB24ATkpv3tPutFonxmnC/jmIV\nIuhCkoHn6kT/zPrZzsoKN4ihH9fSZT4Ezot5lZE2LI0cRkug3nD7khw3fHHe\nogt8nomxOW6Tm6y054BctCuvmg5xsf450ij9yqvEkZqM9BT9YWxbS4NYOOMb\nz5goaCfQrXf2hDuFMrOHDKpun0rqHN+5wMJFHHpsBphVwAmn5JvwOhCiGwhm\n9DsDQTkBrHrecjtJVrXhbnA53IchaFbcBgdWBNyJwlpOheh7GsgoqF1cJqSs\nx1JCamuMA/DaNOzc+IgaeMLHJMNhTNnuMOInU9cZ2p9Hi6nqgRRVEGRwvbDc\nTzfs\r\n=zoId\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYhWiEnRXJeEZ+T6Tji85Si+VnW2uee1NmDPxYKSQ5GQIhAJL39z2XNdW8VsEx61Rncl5R+n5siFSHAXx+cIG9cJpn"}]},"maintainers":[{"name":"corygibbons","email":"hello@corygibbons.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-source-shopify_1.1.0_1529900937432_0.6666444075321984"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-25T04:28:57.161Z","1.1.0":"2018-06-25T04:28:57.714Z","modified":"2022-04-05T01:26:12.020Z"},"maintainers":[{"name":"corygibbons","email":"hello@corygibbons.com"}],"description":"Gatsby source plugin for building websites using Shopfiy as a data source","homepage":"https://github.com/angeloashmore/gatsby-source-shopify","keywords":["gatsby","gatsby-plugin","gatsby-source-plugin","shopify"],"repository":{"type":"git","url":"git+https://github.com/angeloashmore/gatsby-source-shopify.git"},"author":{"name":"Angelo Ashmore"},"bugs":{"url":"https://github.com/angeloashmore/gatsby-source-shopify/issues"},"license":"MIT","readme":"# gatsby-source-shopify\n\nSource plugin for pulling data into [Gatsby][gatsby] from [Shopify][shopify]\nstores via the [Shopify Storefront API][shopify-storefront-api].\n\n## Features\n\n- Provides public shop data available via the [Shopify Storefront API][shopify-storefront-api]\n- Supports `gatsby-transformer-sharp` and `gatsby-image` for product and\n  article images\n\n## Install\n\n```sh\nnpm install --save gatsby-source-shopify\n```\n\n## How to use\n\n```js\n// In your gatsby-config.js\nplugins: [\n  /*\n   * Gatsby's data processing layer begins with “source”\n   * plugins. Here the site sources its data from Shopify.\n   */\n  {\n    resolve: 'gatsby-source-shopify',\n    options: {\n      // The domain name of your Shopify shop. This is required.\n      // Example: 'gatsby-source-shopify-test-shop' if your Shopify address is\n      // 'gatsby-source-shopify-test-shop.myshopify.com'.\n      shopName: 'gatsby-source-shopify-test-shop',\n\n      // An API access token to your Shopify shop. This is required.\n      // You can generate an access token in the \"Manage private apps\" section\n      // of your shop's Apps settings. In the Storefront API section, be sure\n      // to select \"Allow this app to access your storefront data using the\n      // Storefront API\".\n      // See: https://help.shopify.com/api/custom-storefronts/storefront-api/getting-started#authentication\n      accessToken: 'example-wou7evoh0eexuf6chooz2jai2qui9pae4tieph1sei4deiboj',\n\n      // Set verbose to true to display a verbose output on `npm run develop`\n      // or `npm run build`. This prints which nodes are being fetched and how\n      // much time was required to fetch and process the data.\n      // Defaults to true.\n      verbose: true,\n    },\n  },\n]\n```\n\n## How to query\n\nYou can query nodes created from Shopify using GraphQL like the following:\n\n**Note**: Learn to use the GraphQL tool and Ctrl+Spacebar at\n<http://localhost:3000/___graphql> to discover the types and properties of your\nGraphQL model.\n\n```graphql\n{\n  allShopifyProduct {\n    edges {\n      node {\n        id\n        title\n        handle\n        productType\n        vendor\n        variants {\n          id\n          title\n          price\n        }\n      }\n    }\n  }\n}\n```\n\nAll Shopify data is pulled using the [Shopify Storefront\nAPI][shopify-storefront-api]. Data is made available in the same structure as\nprovided by the API, with a few exceptions noted below.\n\nThe following data types are available:\n\n| Name               | Description                                                                                                           |\n| ------------------ | --------------------------------------------------------------------------------------------------------------------- |\n| **Article**        | A blog entry.                                                                                                         |\n| **Blog**           | Collection of articles.                                                                                               |\n| **Comment**        | A comment on a blog entry.                                                                                            |\n| **Collection**     | Represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. |\n| **Product**        | Represents an individual item for sale in a Shopify store.                                                            |\n| **ProductOption**  | Custom product property names.                                                                                        |\n| **ProductVariant** | Represents a different version of a product, such as differing sizes or differing colors.                             |\n| **ShopPolicy**     | Policy that a merchant has configured for their store, such as their refund or privacy policy.                        |\n\nFor each data type listed above, `shopify${typeName}` and\n`allShopify${typeName}` is made available. Nodes that are closely related, such\nas `Article` and `Comment`, are provided as node fields as described below.\n\n**Note**: The following examples are not a complete reference to the available\nfields for each node. Utilize Gatsby's built-in GraphQL tool to discover the\ntypes and properties available.\n\n### Query articles\n\nThe associated blog data is provided on the `blog` field. Article comments are\nprovided on the `comments` field.\n\n```graphql\n{\n  allShopifyArticle {\n    edge {\n      node {\n        id\n        author {\n          email\n          name\n        }\n        blog {\n          title\n        }\n        comments {\n          id\n          author {\n            email\n            name\n          }\n          contentHtml\n        }\n        contentHtml\n        publishedAt(formatString: \"ddd, MMMM Do, YYYY\")\n      }\n    }\n  }\n}\n```\n\n### Query blogs\n\nBlog data is provided on the `blog` field on `Article`, but it can be queried\ndirectly like the following:\n\n```graphql\n{\n  allShopifyBlog {\n    edge {\n      node {\n        id\n        title\n        url\n      }\n    }\n  }\n}\n```\n\n### Query article comments\n\nComments are provided on the `comments` field on `Article`, but they can be\nqueried directly like the following:\n\n```graphql\n{\n  allShopifyComment {\n    edge {\n      node {\n        id\n        author {\n          email\n          name\n        }\n        contentHtml\n      }\n    }\n  }\n}\n```\n\n### Query product collections\n\nProducts in the collection are provided on the `products` field.\n\n```graphql\n{\n  allShopifyCollection {\n    edge {\n      node {\n        id\n        descriptionHtml\n        handle\n        image {\n          src\n          alt\n        }\n        products {\n          id\n          handle\n          title\n        }\n        title\n      }\n    }\n  }\n}\n```\n\n### Query products\n\nProduct variants and options are provided on the `variants` and `options`\nfields.\n\n```graphql\n{\n  allShopifyProduct {\n    edge {\n      node {\n        id\n        descriptionHtml\n        handle\n        images {\n          originalSrc\n        }\n        variants {\n          id\n          availableForSale\n          image {\n            originalSrc\n          }\n          price\n          selectedOptions {\n            name\n            value\n          }\n          sku\n          title\n        }\n        title\n      }\n    }\n  }\n}\n```\n\n### Query product options\n\nProduct options are provided on the `options` field on `Product`, but they can\nbe queried directly like the following:\n\n```graphql\n{\n  allShopifyProductOption {\n    edge {\n      node {\n        id\n        name\n        values\n      }\n    }\n  }\n}\n```\n\n### Query product variants\n\nProduct variants are provided on the `variants` field on `Product`, but they\ncan be queried directly like the following:\n\n```graphql\n{\n  allShopifyProductVariant {\n    edge {\n      node {\n        id\n        availableForSale\n        image {\n          originalSrc\n        }\n        price\n        selectedOptions {\n          name\n          value\n        }\n        sku\n        title\n      }\n    }\n  }\n}\n```\n\n### Query shop policies\n\nShop policies include the following types:\n\n- Privacy Policy (`privacyPolicy`)\n- Refund Policy (`refundPolicy`)\n- Terms of Service (`termsOfService`)\n\nThe type of policy is provided on the `type` field. Policies can be queried\nlike the following:\n\n```graphql\n{\n  allShopifyShopPolicy {\n    edge {\n      node {\n        body\n        title\n        type\n      }\n    }\n  }\n}\n```\n\n### Image processing\n\nTo use image processing you need `gatsby-transformer-sharp`,\n`gatsby-plugin-sharp`, and their dependencies `gatsby-image` and\n`gatsby-source-filesystem` in your `gatsby-config.js`.\n\nYou can apply image processing to any image field on a node. Image processing\nof inline images added to description fields is currently not supported.\n\nTo access image processing in your queries, you need to use this pattern, where\n`...ImageFragment` is one of the [`gatsby-transformer-sharp`\nfragments][gatsby-image-fragments]:\n\n```graphql\n{\n  allShopifyProduct {\n    edges {\n      node {\n        id\n        images {\n          localFile {\n            childImageSharp {\n              ...ImageFragment\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nFull example:\n\n```graphql\n{\n  allShopifyProduct {\n    edges {\n      node {\n        id\n        images {\n          localFile {\n            childImageSharp {\n              resolutions(width: 500, height: 300) {\n                ...GatsbyImageSharpResolutions_withWebp\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nTo learn more about image processing, check the documentation of\n[gatsby-plugin-sharp][gatsby-plugin-sharp].\n\n## Site's `gatsby-node.js` example\n\n```js\nconst path = require('path')\n\nexports.createPages = async ({ graphql, boundActionCreators }) => {\n  const { createPage } = boundActionCreators\n\n  const pages = await graphql(`\n    {\n      allShopifyProduct {\n        edges {\n          node {\n            id\n            handle\n          }\n        }\n      }\n    }\n  `)\n\n  pages.data.allShopifyProduct.edges.forEach(edge => {\n    createPage({\n      path: `/${edge.node.handle}`,\n      component: path.resolve('./src/templates/product.js'),\n      context: {\n        id: edge.node.id,\n      },\n    })\n  })\n}\n```\n\n## A note on customer information\n\nNot all Shopify nodes have been implemented as they are not necessary for the\nstatic portion of a Gatsby-generated website. This includes any node that\ncontains sensitive customer-specific information, such as `Order` and\n`Payment`.\n\nIf you are in need of this data (e.g. building a private, internal website),\nplease open an issue. Until then, the nodes will not be implemented to lessen\nthe chances of someone accidentally making private information publicly\navailable.\n\n[gatsby]: https://www.gatsbyjs.org/\n[shopify]: https://www.shopify.com/\n[shopify-storefront-api]: https://help.shopify.com/api/custom-storefronts/storefront-api\n[graphql-inline-fragments]: http://graphql.org/learn/queries/#inline-fragments\n[gatsby-plugin-sharp]: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-sharp\n[gatsby-image-fragments]: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-image#gatsby-transformer-sharp\n","readmeFilename":"README.md"}