├── .github └── FUNDING.yml ├── .babelrc ├── .gitignore ├── .prettierrc.json ├── src ├── utils.js ├── gatsby-ssr.js ├── getRootQuery.js ├── fragments.js ├── pages.js ├── preview-template.js ├── index.js ├── babel-loader.js ├── gatsby-node.js ├── graphql-nodes.js └── preview.boilerplate.js ├── package.json └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: NathHorrigan 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["babel-preset-gatsby-package"] 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /*.js 3 | .cache 4 | babel-plugin-remove-graphql-queries 5 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "tabWidth": 4, 4 | "singleQuote": true 5 | } 6 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | const { prepareOptions } = require(`gatsby/dist/utils/babel-loader-helpers`) 2 | 3 | exports.prepareOptions = (babel, options = {}, resolve = require.resolve) => { 4 | const items = prepareOptions(babel, options, resolve) 5 | 6 | if (items.length > 2) { 7 | items[3].splice( 8 | 0, 9 | 1, 10 | babel.createConfigItem( 11 | [ 12 | require.resolve( 13 | 'babel-plugin-remove-graphql-queries' 14 | ) 15 | ], 16 | { 17 | type: 'plugin' 18 | } 19 | ) 20 | ) 21 | } 22 | 23 | return items 24 | } 25 | -------------------------------------------------------------------------------- /src/gatsby-ssr.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | exports.onRenderBody = ({ setHeadComponents }, pluginOptions) => { 4 | const { 5 | typeName, 6 | fieldName, 7 | isDefault = true, 8 | url, 9 | websocketUrl = null, 10 | headers 11 | } = pluginOptions 12 | 13 | const connectionName = isDefault ? 'default' : fieldName 14 | 15 | setHeadComponents([ 16 |