@depup/gatsby 5.16.1-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +142 -0
- package/adapters.js +31 -0
- package/apis.json +73 -0
- package/cache-dir/.eslintrc.json +10 -0
- package/cache-dir/api-runner-browser-plugins.js +14 -0
- package/cache-dir/api-runner-browser.js +52 -0
- package/cache-dir/api-runner-ssr.js +88 -0
- package/cache-dir/api-ssr-docs.js +207 -0
- package/cache-dir/app.js +249 -0
- package/cache-dir/blank.css +0 -0
- package/cache-dir/commonjs/api-runner-browser-plugins.js +17 -0
- package/cache-dir/commonjs/api-runner-browser-plugins.js.map +1 -0
- package/cache-dir/commonjs/api-runner-browser.js +49 -0
- package/cache-dir/commonjs/api-runner-browser.js.map +1 -0
- package/cache-dir/commonjs/api-runner-ssr.js +88 -0
- package/cache-dir/commonjs/api-runner-ssr.js.map +1 -0
- package/cache-dir/commonjs/api-ssr-docs.js +210 -0
- package/cache-dir/commonjs/api-ssr-docs.js.map +1 -0
- package/cache-dir/commonjs/app.js +197 -0
- package/cache-dir/commonjs/app.js.map +1 -0
- package/cache-dir/commonjs/context-utils.js +25 -0
- package/cache-dir/commonjs/context-utils.js.map +1 -0
- package/cache-dir/commonjs/create-content-digest-browser-shim.js +4 -0
- package/cache-dir/commonjs/create-content-digest-browser-shim.js.map +1 -0
- package/cache-dir/commonjs/css-to-object.js +21 -0
- package/cache-dir/commonjs/css-to-object.js.map +1 -0
- package/cache-dir/commonjs/debug-log.js +11 -0
- package/cache-dir/commonjs/debug-log.js.map +1 -0
- package/cache-dir/commonjs/default-html.js +33 -0
- package/cache-dir/commonjs/default-html.js.map +1 -0
- package/cache-dir/commonjs/dev-loader.js +247 -0
- package/cache-dir/commonjs/dev-loader.js.map +1 -0
- package/cache-dir/commonjs/develop-static-entry.js +129 -0
- package/cache-dir/commonjs/develop-static-entry.js.map +1 -0
- package/cache-dir/commonjs/dummy.js +8 -0
- package/cache-dir/commonjs/dummy.js.map +1 -0
- package/cache-dir/commonjs/emitter.js +10 -0
- package/cache-dir/commonjs/emitter.js.map +1 -0
- package/cache-dir/commonjs/ensure-resources.js +107 -0
- package/cache-dir/commonjs/ensure-resources.js.map +1 -0
- package/cache-dir/commonjs/error-overlay-handler.js +35 -0
- package/cache-dir/commonjs/error-overlay-handler.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/accordion.js +80 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/accordion.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/build-error.js +44 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/build-error.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/code-frame.js +38 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/code-frame.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/dev-ssr-error.js +52 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/dev-ssr-error.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/error-boundary.js +31 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/error-boundary.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/getserverdata-error.js +47 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/getserverdata-error.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/graphql-errors.js +77 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/graphql-errors.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/hooks.js +93 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/hooks.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/overlay.js +147 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/overlay.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/runtime-errors.js +110 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/runtime-errors.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/use-id.js +50 -0
- package/cache-dir/commonjs/fast-refresh-overlay/components/use-id.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/focus-trap.js +2879 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/focus-trap.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/keys.js +84 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/keys.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/lock-body.js +48 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/lock-body.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/match.js +44 -0
- package/cache-dir/commonjs/fast-refresh-overlay/helpers/match.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/index.js +182 -0
- package/cache-dir/commonjs/fast-refresh-overlay/index.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/style.js +418 -0
- package/cache-dir/commonjs/fast-refresh-overlay/style.js.map +1 -0
- package/cache-dir/commonjs/fast-refresh-overlay/utils.js +75 -0
- package/cache-dir/commonjs/fast-refresh-overlay/utils.js.map +1 -0
- package/cache-dir/commonjs/find-path.js +145 -0
- package/cache-dir/commonjs/find-path.js.map +1 -0
- package/cache-dir/commonjs/gatsby-browser-entry.js +52 -0
- package/cache-dir/commonjs/gatsby-browser-entry.js.map +1 -0
- package/cache-dir/commonjs/head/components/fire-callback-in-effect.js +18 -0
- package/cache-dir/commonjs/head/components/fire-callback-in-effect.js.map +1 -0
- package/cache-dir/commonjs/head/components/head-components.js +72 -0
- package/cache-dir/commonjs/head/components/head-components.js.map +1 -0
- package/cache-dir/commonjs/head/constants.js +13 -0
- package/cache-dir/commonjs/head/constants.js.map +1 -0
- package/cache-dir/commonjs/head/head-export-handler-for-browser.js +144 -0
- package/cache-dir/commonjs/head/head-export-handler-for-browser.js.map +1 -0
- package/cache-dir/commonjs/head/head-export-handler-for-ssr.js +225 -0
- package/cache-dir/commonjs/head/head-export-handler-for-ssr.js.map +1 -0
- package/cache-dir/commonjs/head/utils.js +264 -0
- package/cache-dir/commonjs/head/utils.js.map +1 -0
- package/cache-dir/commonjs/loader.js +861 -0
- package/cache-dir/commonjs/loader.js.map +1 -0
- package/cache-dir/commonjs/loading-indicator/index.js +25 -0
- package/cache-dir/commonjs/loading-indicator/index.js.map +1 -0
- package/cache-dir/commonjs/loading-indicator/indicator.js +63 -0
- package/cache-dir/commonjs/loading-indicator/indicator.js.map +1 -0
- package/cache-dir/commonjs/loading-indicator/style.js +103 -0
- package/cache-dir/commonjs/loading-indicator/style.js.map +1 -0
- package/cache-dir/commonjs/navigation.js +260 -0
- package/cache-dir/commonjs/navigation.js.map +1 -0
- package/cache-dir/commonjs/normalize-page-path.js +22 -0
- package/cache-dir/commonjs/normalize-page-path.js.map +1 -0
- package/cache-dir/commonjs/page-renderer.js +59 -0
- package/cache-dir/commonjs/page-renderer.js.map +1 -0
- package/cache-dir/commonjs/pages.json +1 -0
- package/cache-dir/commonjs/polyfill-entry.js +7 -0
- package/cache-dir/commonjs/polyfill-entry.js.map +1 -0
- package/cache-dir/commonjs/prefetch.js +67 -0
- package/cache-dir/commonjs/prefetch.js.map +1 -0
- package/cache-dir/commonjs/production-app.js +256 -0
- package/cache-dir/commonjs/production-app.js.map +1 -0
- package/cache-dir/commonjs/public-page-renderer-dev.js +26 -0
- package/cache-dir/commonjs/public-page-renderer-dev.js.map +1 -0
- package/cache-dir/commonjs/public-page-renderer-prod.js +30 -0
- package/cache-dir/commonjs/public-page-renderer-prod.js.map +1 -0
- package/cache-dir/commonjs/public-page-renderer.js +11 -0
- package/cache-dir/commonjs/public-page-renderer.js.map +1 -0
- package/cache-dir/commonjs/query-result-store.js +160 -0
- package/cache-dir/commonjs/query-result-store.js.map +1 -0
- package/cache-dir/commonjs/react-dom-utils.js +34 -0
- package/cache-dir/commonjs/react-dom-utils.js.map +1 -0
- package/cache-dir/commonjs/react-lifecycles-compat.js +4 -0
- package/cache-dir/commonjs/react-lifecycles-compat.js.map +1 -0
- package/cache-dir/commonjs/redirect-utils.js +25 -0
- package/cache-dir/commonjs/redirect-utils.js.map +1 -0
- package/cache-dir/commonjs/redirects.json +1 -0
- package/cache-dir/commonjs/register-service-worker.js +66 -0
- package/cache-dir/commonjs/register-service-worker.js.map +1 -0
- package/cache-dir/commonjs/root.js +105 -0
- package/cache-dir/commonjs/root.js.map +1 -0
- package/cache-dir/commonjs/route-announcer-props.js +24 -0
- package/cache-dir/commonjs/route-announcer-props.js.map +1 -0
- package/cache-dir/commonjs/server-utils/writable-as-promise.js +42 -0
- package/cache-dir/commonjs/server-utils/writable-as-promise.js.map +1 -0
- package/cache-dir/commonjs/shadow-portal.js +36 -0
- package/cache-dir/commonjs/shadow-portal.js.map +1 -0
- package/cache-dir/commonjs/slice/context.js +15 -0
- package/cache-dir/commonjs/slice/context.js.map +1 -0
- package/cache-dir/commonjs/slice/inline-slice.js +34 -0
- package/cache-dir/commonjs/slice/inline-slice.js.map +1 -0
- package/cache-dir/commonjs/slice/server-slice-renderer.js +29 -0
- package/cache-dir/commonjs/slice/server-slice-renderer.js.map +1 -0
- package/cache-dir/commonjs/slice/server-slice.js +54 -0
- package/cache-dir/commonjs/slice/server-slice.js.map +1 -0
- package/cache-dir/commonjs/slice.js +124 -0
- package/cache-dir/commonjs/slice.js.map +1 -0
- package/cache-dir/commonjs/socketIo.js +62 -0
- package/cache-dir/commonjs/socketIo.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/child_process.js +8 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/child_process.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/fs.js +7 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/fs.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http.js +9 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http2.js +7 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/http2.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/https.js +9 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/https.js.map +1 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js +55 -0
- package/cache-dir/commonjs/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js.map +1 -0
- package/cache-dir/commonjs/ssr-develop-static-entry.js +366 -0
- package/cache-dir/commonjs/ssr-develop-static-entry.js.map +1 -0
- package/cache-dir/commonjs/static-entry.js +544 -0
- package/cache-dir/commonjs/static-entry.js.map +1 -0
- package/cache-dir/commonjs/static-query.js +74 -0
- package/cache-dir/commonjs/static-query.js.map +1 -0
- package/cache-dir/commonjs/strip-prefix.js +22 -0
- package/cache-dir/commonjs/strip-prefix.js.map +1 -0
- package/cache-dir/context-utils.js +29 -0
- package/cache-dir/create-content-digest-browser-shim.js +1 -0
- package/cache-dir/css-to-object.js +19 -0
- package/cache-dir/debug-log.js +13 -0
- package/cache-dir/default-html.js +36 -0
- package/cache-dir/dev-loader.js +280 -0
- package/cache-dir/develop-static-entry.js +129 -0
- package/cache-dir/dummy.js +2 -0
- package/cache-dir/emitter.js +4 -0
- package/cache-dir/ensure-resources.js +119 -0
- package/cache-dir/error-overlay-handler.js +36 -0
- package/cache-dir/fast-refresh-overlay/components/accordion.js +83 -0
- package/cache-dir/fast-refresh-overlay/components/build-error.js +46 -0
- package/cache-dir/fast-refresh-overlay/components/code-frame.js +38 -0
- package/cache-dir/fast-refresh-overlay/components/dev-ssr-error.js +66 -0
- package/cache-dir/fast-refresh-overlay/components/error-boundary.js +28 -0
- package/cache-dir/fast-refresh-overlay/components/getserverdata-error.js +53 -0
- package/cache-dir/fast-refresh-overlay/components/graphql-errors.js +100 -0
- package/cache-dir/fast-refresh-overlay/components/hooks.js +102 -0
- package/cache-dir/fast-refresh-overlay/components/overlay.js +143 -0
- package/cache-dir/fast-refresh-overlay/components/runtime-errors.js +139 -0
- package/cache-dir/fast-refresh-overlay/components/use-id.js +56 -0
- package/cache-dir/fast-refresh-overlay/helpers/focus-trap.js +3561 -0
- package/cache-dir/fast-refresh-overlay/helpers/keys.js +80 -0
- package/cache-dir/fast-refresh-overlay/helpers/lock-body.js +52 -0
- package/cache-dir/fast-refresh-overlay/helpers/match.js +42 -0
- package/cache-dir/fast-refresh-overlay/index.js +147 -0
- package/cache-dir/fast-refresh-overlay/style.js +413 -0
- package/cache-dir/fast-refresh-overlay/utils.js +81 -0
- package/cache-dir/find-path.js +160 -0
- package/cache-dir/gatsby-browser-entry.js +27 -0
- package/cache-dir/head/components/fire-callback-in-effect.js +12 -0
- package/cache-dir/head/components/head-components.js +86 -0
- package/cache-dir/head/constants.js +15 -0
- package/cache-dir/head/head-export-handler-for-browser.js +170 -0
- package/cache-dir/head/head-export-handler-for-ssr.js +237 -0
- package/cache-dir/head/utils.js +287 -0
- package/cache-dir/loader.js +977 -0
- package/cache-dir/loading-indicator/index.js +19 -0
- package/cache-dir/loading-indicator/indicator.js +65 -0
- package/cache-dir/loading-indicator/style.js +99 -0
- package/cache-dir/navigation.js +257 -0
- package/cache-dir/normalize-page-path.js +17 -0
- package/cache-dir/page-renderer.js +59 -0
- package/cache-dir/page-ssr/index.d.ts +76 -0
- package/cache-dir/pages.json +1 -0
- package/cache-dir/polyfill-entry.js +5 -0
- package/cache-dir/prefetch.js +80 -0
- package/cache-dir/production-app.js +340 -0
- package/cache-dir/public-page-renderer-dev.js +21 -0
- package/cache-dir/public-page-renderer-prod.js +25 -0
- package/cache-dir/public-page-renderer.js +9 -0
- package/cache-dir/query-engine/index.d.ts +31 -0
- package/cache-dir/query-result-store.js +197 -0
- package/cache-dir/react-dom-utils.js +38 -0
- package/cache-dir/react-lifecycles-compat.js +1 -0
- package/cache-dir/redirect-utils.js +22 -0
- package/cache-dir/redirects.json +1 -0
- package/cache-dir/register-service-worker.js +64 -0
- package/cache-dir/root.js +147 -0
- package/cache-dir/route-announcer-props.js +18 -0
- package/cache-dir/server-utils/writable-as-promise.js +41 -0
- package/cache-dir/shadow-portal.js +28 -0
- package/cache-dir/slice/context.js +13 -0
- package/cache-dir/slice/inline-slice.js +34 -0
- package/cache-dir/slice/server-slice-renderer.js +28 -0
- package/cache-dir/slice/server-slice.js +52 -0
- package/cache-dir/slice.js +158 -0
- package/cache-dir/socketIo.js +58 -0
- package/cache-dir/ssr-builtin-trackers/child_process.js +4 -0
- package/cache-dir/ssr-builtin-trackers/fs.js +3 -0
- package/cache-dir/ssr-builtin-trackers/http.js +3 -0
- package/cache-dir/ssr-builtin-trackers/http2.js +3 -0
- package/cache-dir/ssr-builtin-trackers/https.js +3 -0
- package/cache-dir/ssr-builtin-trackers/tracking-unsafe-module-wrapper.js +64 -0
- package/cache-dir/ssr-develop-static-entry.js +428 -0
- package/cache-dir/static-entry.js +594 -0
- package/cache-dir/static-query.js +91 -0
- package/cache-dir/strip-prefix.js +20 -0
- package/changes.json +454 -0
- package/cli.js +3 -0
- package/dist/bin/gatsby.js +5 -0
- package/dist/bin/gatsby.js.map +1 -0
- package/dist/bootstrap/__mocks__/get-config/ts/gatsby-config.d.ts +3 -0
- package/dist/bootstrap/__mocks__/resolve-module-exports.d.ts +1 -0
- package/dist/bootstrap/create-graphql-runner.d.ts +10 -0
- package/dist/bootstrap/create-graphql-runner.js +71 -0
- package/dist/bootstrap/create-graphql-runner.js.map +1 -0
- package/dist/bootstrap/get-config-file.d.ts +4 -0
- package/dist/bootstrap/get-config-file.js +152 -0
- package/dist/bootstrap/get-config-file.js.map +1 -0
- package/dist/bootstrap/index.d.ts +12 -0
- package/dist/bootstrap/index.js +56 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/bootstrap/load-config/index.d.ts +7 -0
- package/dist/bootstrap/load-config/index.js +73 -0
- package/dist/bootstrap/load-config/index.js.map +1 -0
- package/dist/bootstrap/load-plugins/index.d.ts +3 -0
- package/dist/bootstrap/load-plugins/index.js +79 -0
- package/dist/bootstrap/load-plugins/index.js.map +1 -0
- package/dist/bootstrap/load-plugins/load-internal-plugins.d.ts +2 -0
- package/dist/bootstrap/load-plugins/load-internal-plugins.js +105 -0
- package/dist/bootstrap/load-plugins/load-internal-plugins.js.map +1 -0
- package/dist/bootstrap/load-plugins/process-plugin.d.ts +2 -0
- package/dist/bootstrap/load-plugins/process-plugin.js +81 -0
- package/dist/bootstrap/load-plugins/process-plugin.js.map +1 -0
- package/dist/bootstrap/load-plugins/resolve-plugin.d.ts +13 -0
- package/dist/bootstrap/load-plugins/resolve-plugin.js +75 -0
- package/dist/bootstrap/load-plugins/resolve-plugin.js.map +1 -0
- package/dist/bootstrap/load-plugins/types.d.ts +48 -0
- package/dist/bootstrap/load-plugins/types.js +4 -0
- package/dist/bootstrap/load-plugins/types.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/check-local-plugin.d.ts +8 -0
- package/dist/bootstrap/load-plugins/utils/check-local-plugin.js +38 -0
- package/dist/bootstrap/load-plugins/utils/check-local-plugin.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/create-hash.d.ts +1 -0
- package/dist/bootstrap/load-plugins/utils/create-hash.js +20 -0
- package/dist/bootstrap/load-plugins/utils/create-hash.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/create-id.d.ts +10 -0
- package/dist/bootstrap/load-plugins/utils/create-id.js +16 -0
- package/dist/bootstrap/load-plugins/utils/create-id.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/flatten-plugins.d.ts +2 -0
- package/dist/bootstrap/load-plugins/utils/flatten-plugins.js +41 -0
- package/dist/bootstrap/load-plugins/utils/flatten-plugins.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/get-api.d.ts +12 -0
- package/dist/bootstrap/load-plugins/utils/get-api.js +12 -0
- package/dist/bootstrap/load-plugins/utils/get-api.js.map +1 -0
- package/dist/bootstrap/load-plugins/utils/normalize.d.ts +5 -0
- package/dist/bootstrap/load-plugins/utils/normalize.js +33 -0
- package/dist/bootstrap/load-plugins/utils/normalize.js.map +1 -0
- package/dist/bootstrap/load-plugins/validate.d.ts +41 -0
- package/dist/bootstrap/load-plugins/validate.js +369 -0
- package/dist/bootstrap/load-plugins/validate.js.map +1 -0
- package/dist/bootstrap/load-themes/index.d.ts +17 -0
- package/dist/bootstrap/load-themes/index.js +186 -0
- package/dist/bootstrap/load-themes/index.js.map +1 -0
- package/dist/bootstrap/log-line-function.d.ts +0 -0
- package/dist/bootstrap/log-line-function.js +19 -0
- package/dist/bootstrap/log-line-function.js.map +1 -0
- package/dist/bootstrap/prefer-default.d.ts +1 -0
- package/dist/bootstrap/prefer-default.js +7 -0
- package/dist/bootstrap/prefer-default.js.map +1 -0
- package/dist/bootstrap/redirects-writer.d.ts +2 -0
- package/dist/bootstrap/redirects-writer.js +59 -0
- package/dist/bootstrap/redirects-writer.js.map +1 -0
- package/dist/bootstrap/remove-stale-jobs.d.ts +2 -0
- package/dist/bootstrap/remove-stale-jobs.js +31 -0
- package/dist/bootstrap/remove-stale-jobs.js.map +1 -0
- package/dist/bootstrap/requires-writer.d.ts +11 -0
- package/dist/bootstrap/requires-writer.js +260 -0
- package/dist/bootstrap/requires-writer.js.map +1 -0
- package/dist/bootstrap/resolve-js-file-path.d.ts +14 -0
- package/dist/bootstrap/resolve-js-file-path.js +58 -0
- package/dist/bootstrap/resolve-js-file-path.js.map +1 -0
- package/dist/bootstrap/resolve-module-exports.d.ts +20 -0
- package/dist/bootstrap/resolve-module-exports.js +188 -0
- package/dist/bootstrap/resolve-module-exports.js.map +1 -0
- package/dist/bootstrap/schema-hot-reloader.d.ts +3 -0
- package/dist/bootstrap/schema-hot-reloader.js +60 -0
- package/dist/bootstrap/schema-hot-reloader.js.map +1 -0
- package/dist/cache/cache-fs.d.ts +1 -0
- package/dist/cache/cache-fs.js +270 -0
- package/dist/cache/cache-fs.js.map +1 -0
- package/dist/cache/json-file-store.d.ts +8 -0
- package/dist/cache/json-file-store.js +144 -0
- package/dist/cache/json-file-store.js.map +1 -0
- package/dist/cache/wrap-callback.d.ts +0 -0
- package/dist/cache/wrap-callback.js +49 -0
- package/dist/cache/wrap-callback.js.map +1 -0
- package/dist/commands/build-html.d.ts +69 -0
- package/dist/commands/build-html.js +652 -0
- package/dist/commands/build-html.js.map +1 -0
- package/dist/commands/build-javascript.d.ts +4 -0
- package/dist/commands/build-javascript.js +18 -0
- package/dist/commands/build-javascript.js.map +1 -0
- package/dist/commands/build-utils.d.ts +8 -0
- package/dist/commands/build-utils.js +186 -0
- package/dist/commands/build-utils.js.map +1 -0
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.js +505 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/clean.d.ts +1 -0
- package/dist/commands/clean.js +29 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/develop-process.d.ts +1 -0
- package/dist/commands/develop-process.js +120 -0
- package/dist/commands/develop-process.js.map +1 -0
- package/dist/commands/develop-static.d.ts +3 -0
- package/dist/commands/develop-static.js +22 -0
- package/dist/commands/develop-static.js.map +1 -0
- package/dist/commands/develop.d.ts +2 -0
- package/dist/commands/develop.js +273 -0
- package/dist/commands/develop.js.map +1 -0
- package/dist/commands/feedback.d.ts +1 -0
- package/dist/commands/feedback.js +17 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/repl.d.ts +1 -0
- package/dist/commands/repl.js +58 -0
- package/dist/commands/repl.js.map +1 -0
- package/dist/commands/serve.d.ts +1 -0
- package/dist/commands/serve.js +282 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/types.d.ts +54 -0
- package/dist/commands/types.js +23 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -0
- package/dist/datastore/common/iterable.d.ts +51 -0
- package/dist/datastore/common/iterable.js +217 -0
- package/dist/datastore/common/iterable.js.map +1 -0
- package/dist/datastore/common/query.d.ts +69 -0
- package/dist/datastore/common/query.js +219 -0
- package/dist/datastore/common/query.js.map +1 -0
- package/dist/datastore/datastore.d.ts +2 -0
- package/dist/datastore/datastore.js +23 -0
- package/dist/datastore/datastore.js.map +1 -0
- package/dist/datastore/in-memory/in-memory-datastore.d.ts +2 -0
- package/dist/datastore/in-memory/in-memory-datastore.js +75 -0
- package/dist/datastore/in-memory/in-memory-datastore.js.map +1 -0
- package/dist/datastore/in-memory/indexing.d.ts +80 -0
- package/dist/datastore/in-memory/indexing.js +994 -0
- package/dist/datastore/in-memory/indexing.js.map +1 -0
- package/dist/datastore/in-memory/run-fast-filters.d.ts +27 -0
- package/dist/datastore/in-memory/run-fast-filters.js +276 -0
- package/dist/datastore/in-memory/run-fast-filters.js.map +1 -0
- package/dist/datastore/index.d.ts +20 -0
- package/dist/datastore/index.js +34 -0
- package/dist/datastore/index.js.map +1 -0
- package/dist/datastore/lmdb/lmdb-datastore.d.ts +14 -0
- package/dist/datastore/lmdb/lmdb-datastore.js +261 -0
- package/dist/datastore/lmdb/lmdb-datastore.js.map +1 -0
- package/dist/datastore/lmdb/query/common.d.ts +23 -0
- package/dist/datastore/lmdb/query/common.js +127 -0
- package/dist/datastore/lmdb/query/common.js.map +1 -0
- package/dist/datastore/lmdb/query/create-index.d.ts +25 -0
- package/dist/datastore/lmdb/query/create-index.js +239 -0
- package/dist/datastore/lmdb/query/create-index.js.map +1 -0
- package/dist/datastore/lmdb/query/filter-using-index.d.ts +43 -0
- package/dist/datastore/lmdb/query/filter-using-index.js +577 -0
- package/dist/datastore/lmdb/query/filter-using-index.js.map +1 -0
- package/dist/datastore/lmdb/query/run-query.d.ts +9 -0
- package/dist/datastore/lmdb/query/run-query.js +285 -0
- package/dist/datastore/lmdb/query/run-query.js.map +1 -0
- package/dist/datastore/lmdb/query/suggest-index.d.ts +15 -0
- package/dist/datastore/lmdb/query/suggest-index.js +93 -0
- package/dist/datastore/lmdb/query/suggest-index.js.map +1 -0
- package/dist/datastore/lmdb/updates/nodes-by-type.d.ts +3 -0
- package/dist/datastore/lmdb/updates/nodes-by-type.js +21 -0
- package/dist/datastore/lmdb/updates/nodes-by-type.js.map +1 -0
- package/dist/datastore/lmdb/updates/nodes.d.ts +5 -0
- package/dist/datastore/lmdb/updates/nodes.js +33 -0
- package/dist/datastore/lmdb/updates/nodes.js.map +1 -0
- package/dist/datastore/types.d.ts +47 -0
- package/dist/datastore/types.js +4 -0
- package/dist/datastore/types.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/gatsby-node.js +42 -0
- package/dist/internal-plugins/bundle-optimisations/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/index.js +3 -0
- package/dist/internal-plugins/bundle-optimisations/index.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/package.json +10 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/fetch.js +4 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/fetch.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/no-op.js +3 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/no-op.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/object-assign.js +4 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/object-assign.js.map +1 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/whatwg-fetch.js +6 -0
- package/dist/internal-plugins/bundle-optimisations/polyfills/whatwg-fetch.js.map +1 -0
- package/dist/internal-plugins/dev-404-page/gatsby-node.js +30 -0
- package/dist/internal-plugins/dev-404-page/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/dev-404-page/index.js +3 -0
- package/dist/internal-plugins/dev-404-page/index.js.map +1 -0
- package/dist/internal-plugins/dev-404-page/package.json +11 -0
- package/dist/internal-plugins/dev-404-page/raw_dev-404-page.js +262 -0
- package/dist/internal-plugins/functions/api-function-webpack-loader.d.ts +3 -0
- package/dist/internal-plugins/functions/api-function-webpack-loader.js +74 -0
- package/dist/internal-plugins/functions/api-function-webpack-loader.js.map +1 -0
- package/dist/internal-plugins/functions/config.d.ts +20 -0
- package/dist/internal-plugins/functions/config.js +96 -0
- package/dist/internal-plugins/functions/config.js.map +1 -0
- package/dist/internal-plugins/functions/gatsby-node.d.ts +3 -0
- package/dist/internal-plugins/functions/gatsby-node.js +452 -0
- package/dist/internal-plugins/functions/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/functions/index.js +3 -0
- package/dist/internal-plugins/functions/index.js.map +1 -0
- package/dist/internal-plugins/functions/middleware.d.ts +11 -0
- package/dist/internal-plugins/functions/middleware.js +160 -0
- package/dist/internal-plugins/functions/middleware.js.map +1 -0
- package/dist/internal-plugins/functions/package.json +11 -0
- package/dist/internal-plugins/internal-data-bridge/gatsby-node.js +191 -0
- package/dist/internal-plugins/internal-data-bridge/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/internal-data-bridge/index.js +3 -0
- package/dist/internal-plugins/internal-data-bridge/index.js.map +1 -0
- package/dist/internal-plugins/internal-data-bridge/package.json +11 -0
- package/dist/internal-plugins/load-babel-config/gatsby-node.js +37 -0
- package/dist/internal-plugins/load-babel-config/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/load-babel-config/index.js +3 -0
- package/dist/internal-plugins/load-babel-config/index.js.map +1 -0
- package/dist/internal-plugins/load-babel-config/package.json +11 -0
- package/dist/internal-plugins/partytown/gatsby-browser.js +23 -0
- package/dist/internal-plugins/partytown/gatsby-browser.js.map +1 -0
- package/dist/internal-plugins/partytown/gatsby-node.d.ts +2 -0
- package/dist/internal-plugins/partytown/gatsby-node.js +60 -0
- package/dist/internal-plugins/partytown/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/partytown/gatsby-ssr.js +39 -0
- package/dist/internal-plugins/partytown/gatsby-ssr.js.map +1 -0
- package/dist/internal-plugins/partytown/index.js +3 -0
- package/dist/internal-plugins/partytown/index.js.map +1 -0
- package/dist/internal-plugins/partytown/package.json +12 -0
- package/dist/internal-plugins/partytown/proxy.d.ts +3 -0
- package/dist/internal-plugins/partytown/proxy.js +26 -0
- package/dist/internal-plugins/partytown/proxy.js.map +1 -0
- package/dist/internal-plugins/partytown/utils/get-forwards.d.ts +2 -0
- package/dist/internal-plugins/partytown/utils/get-forwards.js +8 -0
- package/dist/internal-plugins/partytown/utils/get-forwards.js.map +1 -0
- package/dist/internal-plugins/partytown/utils/inject-partytown-snippet.d.ts +2 -0
- package/dist/internal-plugins/partytown/utils/inject-partytown-snippet.js +28 -0
- package/dist/internal-plugins/partytown/utils/inject-partytown-snippet.js.map +1 -0
- package/dist/internal-plugins/prod-404-500/gatsby-node.js +50 -0
- package/dist/internal-plugins/prod-404-500/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/prod-404-500/index.js +3 -0
- package/dist/internal-plugins/prod-404-500/index.js.map +1 -0
- package/dist/internal-plugins/prod-404-500/package.json +11 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/create-page.js +31 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/create-page.js.map +1 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/gatsby-node.js +31 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/gatsby-node.js.map +1 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/index.js +273 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/index.js.map +1 -0
- package/dist/internal-plugins/webpack-theme-component-shadowing/package.json +11 -0
- package/dist/internal.d.ts +5 -0
- package/dist/internal.js +34 -0
- package/dist/internal.js.map +1 -0
- package/dist/joi-schemas/joi.d.ts +5 -0
- package/dist/joi-schemas/joi.js +122 -0
- package/dist/joi-schemas/joi.js.map +1 -0
- package/dist/query/error-parser.d.ts +19 -0
- package/dist/query/error-parser.js +163 -0
- package/dist/query/error-parser.js.map +1 -0
- package/dist/query/file-parser.js +584 -0
- package/dist/query/file-parser.js.map +1 -0
- package/dist/query/graphql-errors-codeframe.d.ts +1 -0
- package/dist/query/graphql-errors-codeframe.js +20 -0
- package/dist/query/graphql-errors-codeframe.js.map +1 -0
- package/dist/query/graphql-errors.js +278 -0
- package/dist/query/graphql-errors.js.map +1 -0
- package/dist/query/graphql-runner.d.ts +39 -0
- package/dist/query/graphql-runner.js +221 -0
- package/dist/query/graphql-runner.js.map +1 -0
- package/dist/query/graphql-span-tracer.d.ts +19 -0
- package/dist/query/graphql-span-tracer.js +63 -0
- package/dist/query/graphql-span-tracer.js.map +1 -0
- package/dist/query/index.d.ts +32 -0
- package/dist/query/index.js +301 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/query-compiler.js +433 -0
- package/dist/query/query-compiler.js.map +1 -0
- package/dist/query/query-runner.d.ts +13 -0
- package/dist/query/query-runner.js +176 -0
- package/dist/query/query-runner.js.map +1 -0
- package/dist/query/query-watcher.d.ts +17 -0
- package/dist/query/query-watcher.js +250 -0
- package/dist/query/query-watcher.js.map +1 -0
- package/dist/query/transform-document.d.ts +6 -0
- package/dist/query/transform-document.js +131 -0
- package/dist/query/transform-document.js.map +1 -0
- package/dist/query/types.d.ts +35 -0
- package/dist/query/types.js +4 -0
- package/dist/query/types.js.map +1 -0
- package/dist/query/utils.d.ts +4 -0
- package/dist/query/utils.js +20 -0
- package/dist/query/utils.js.map +1 -0
- package/dist/redux/actions/add-page-dependency.d.ts +7 -0
- package/dist/redux/actions/add-page-dependency.js +52 -0
- package/dist/redux/actions/add-page-dependency.js.map +1 -0
- package/dist/redux/actions/index.d.ts +16 -0
- package/dist/redux/actions/index.js +21 -0
- package/dist/redux/actions/index.js.map +1 -0
- package/dist/redux/actions/internal.d.ts +124 -0
- package/dist/redux/actions/internal.js +394 -0
- package/dist/redux/actions/internal.js.map +1 -0
- package/dist/redux/actions/public.js +1354 -0
- package/dist/redux/actions/public.js.map +1 -0
- package/dist/redux/actions/restricted.d.ts +332 -0
- package/dist/redux/actions/restricted.js +521 -0
- package/dist/redux/actions/restricted.js.map +1 -0
- package/dist/redux/index.d.ts +20 -0
- package/dist/redux/index.js +125 -0
- package/dist/redux/index.js.map +1 -0
- package/dist/redux/persist.d.ts +5 -0
- package/dist/redux/persist.js +191 -0
- package/dist/redux/persist.js.map +1 -0
- package/dist/redux/plugin-runner.d.ts +1 -0
- package/dist/redux/plugin-runner.js +45 -0
- package/dist/redux/plugin-runner.js.map +1 -0
- package/dist/redux/reducers/adapter.d.ts +6 -0
- package/dist/redux/reducers/adapter.js +22 -0
- package/dist/redux/reducers/adapter.js.map +1 -0
- package/dist/redux/reducers/babelrc.d.ts +9 -0
- package/dist/redux/reducers/babelrc.js +104 -0
- package/dist/redux/reducers/babelrc.js.map +1 -0
- package/dist/redux/reducers/components-using-slices.d.ts +2 -0
- package/dist/redux/reducers/components-using-slices.js +15 -0
- package/dist/redux/reducers/components-using-slices.js.map +1 -0
- package/dist/redux/reducers/components.d.ts +2 -0
- package/dist/redux/reducers/components.js +104 -0
- package/dist/redux/reducers/components.js.map +1 -0
- package/dist/redux/reducers/config.d.ts +2 -0
- package/dist/redux/reducers/config.js +16 -0
- package/dist/redux/reducers/config.js.map +1 -0
- package/dist/redux/reducers/definitions.d.ts +2 -0
- package/dist/redux/reducers/definitions.js +14 -0
- package/dist/redux/reducers/definitions.js.map +1 -0
- package/dist/redux/reducers/flattened-plugins.d.ts +17 -0
- package/dist/redux/reducers/flattened-plugins.js +14 -0
- package/dist/redux/reducers/flattened-plugins.js.map +1 -0
- package/dist/redux/reducers/functions.d.ts +2 -0
- package/dist/redux/reducers/functions.js +14 -0
- package/dist/redux/reducers/functions.js.map +1 -0
- package/dist/redux/reducers/html.d.ts +25 -0
- package/dist/redux/reducers/html.js +384 -0
- package/dist/redux/reducers/html.js.map +1 -0
- package/dist/redux/reducers/index.d.ts +45 -0
- package/dist/redux/reducers/index.js +86 -0
- package/dist/redux/reducers/index.js.map +1 -0
- package/dist/redux/reducers/inference-metadata.d.ts +7 -0
- package/dist/redux/reducers/inference-metadata.js +174 -0
- package/dist/redux/reducers/inference-metadata.js.map +1 -0
- package/dist/redux/reducers/jobs.d.ts +5 -0
- package/dist/redux/reducers/jobs.js +65 -0
- package/dist/redux/reducers/jobs.js.map +1 -0
- package/dist/redux/reducers/jobsv2.d.ts +6 -0
- package/dist/redux/reducers/jobsv2.js +88 -0
- package/dist/redux/reducers/jobsv2.js.map +1 -0
- package/dist/redux/reducers/last-action.d.ts +2 -0
- package/dist/redux/reducers/last-action.js +7 -0
- package/dist/redux/reducers/last-action.js.map +1 -0
- package/dist/redux/reducers/node-manifest.d.ts +2 -0
- package/dist/redux/reducers/node-manifest.js +58 -0
- package/dist/redux/reducers/node-manifest.js.map +1 -0
- package/dist/redux/reducers/nodes-by-type.d.ts +2 -0
- package/dist/redux/reducers/nodes-by-type.js +53 -0
- package/dist/redux/reducers/nodes-by-type.js.map +1 -0
- package/dist/redux/reducers/nodes-touched.d.ts +3 -0
- package/dist/redux/reducers/nodes-touched.js +18 -0
- package/dist/redux/reducers/nodes-touched.js.map +1 -0
- package/dist/redux/reducers/nodes.d.ts +2 -0
- package/dist/redux/reducers/nodes.js +30 -0
- package/dist/redux/reducers/nodes.js.map +1 -0
- package/dist/redux/reducers/page-data-stats.d.ts +2 -0
- package/dist/redux/reducers/page-data-stats.js +15 -0
- package/dist/redux/reducers/page-data-stats.js.map +1 -0
- package/dist/redux/reducers/pages.d.ts +2 -0
- package/dist/redux/reducers/pages.js +43 -0
- package/dist/redux/reducers/pages.js.map +1 -0
- package/dist/redux/reducers/pending-page-data-writes.d.ts +5 -0
- package/dist/redux/reducers/pending-page-data-writes.js +66 -0
- package/dist/redux/reducers/pending-page-data-writes.js.map +1 -0
- package/dist/redux/reducers/program.d.ts +2 -0
- package/dist/redux/reducers/program.js +62 -0
- package/dist/redux/reducers/program.js.map +1 -0
- package/dist/redux/reducers/queries.d.ts +26 -0
- package/dist/redux/reducers/queries.js +403 -0
- package/dist/redux/reducers/queries.js.map +1 -0
- package/dist/redux/reducers/redirects.d.ts +2 -0
- package/dist/redux/reducers/redirects.js +39 -0
- package/dist/redux/reducers/redirects.js.map +1 -0
- package/dist/redux/reducers/remote-file-allowed-urls.d.ts +2 -0
- package/dist/redux/reducers/remote-file-allowed-urls.js +19 -0
- package/dist/redux/reducers/remote-file-allowed-urls.js.map +1 -0
- package/dist/redux/reducers/resolved-nodes.d.ts +2 -0
- package/dist/redux/reducers/resolved-nodes.js +45 -0
- package/dist/redux/reducers/resolved-nodes.js.map +1 -0
- package/dist/redux/reducers/schema-customization.d.ts +23 -0
- package/dist/redux/reducers/schema-customization.js +103 -0
- package/dist/redux/reducers/schema-customization.js.map +1 -0
- package/dist/redux/reducers/schema.d.ts +3 -0
- package/dist/redux/reducers/schema.js +17 -0
- package/dist/redux/reducers/schema.js.map +1 -0
- package/dist/redux/reducers/set-request-headers.d.ts +7 -0
- package/dist/redux/reducers/set-request-headers.js +24 -0
- package/dist/redux/reducers/set-request-headers.js.map +1 -0
- package/dist/redux/reducers/slices-by-template.d.ts +2 -0
- package/dist/redux/reducers/slices-by-template.js +16 -0
- package/dist/redux/reducers/slices-by-template.js.map +1 -0
- package/dist/redux/reducers/slices.d.ts +2 -0
- package/dist/redux/reducers/slices.js +22 -0
- package/dist/redux/reducers/slices.js.map +1 -0
- package/dist/redux/reducers/stateful-source-plugins.d.ts +5 -0
- package/dist/redux/reducers/stateful-source-plugins.js +20 -0
- package/dist/redux/reducers/stateful-source-plugins.js.map +1 -0
- package/dist/redux/reducers/static-queries-by-template.d.ts +2 -0
- package/dist/redux/reducers/static-queries-by-template.js +19 -0
- package/dist/redux/reducers/static-queries-by-template.js.map +1 -0
- package/dist/redux/reducers/static-query-components.d.ts +2 -0
- package/dist/redux/reducers/static-query-components.js +18 -0
- package/dist/redux/reducers/static-query-components.js.map +1 -0
- package/dist/redux/reducers/status.d.ts +7 -0
- package/dist/redux/reducers/status.js +57 -0
- package/dist/redux/reducers/status.js.map +1 -0
- package/dist/redux/reducers/telemetry.d.ts +2 -0
- package/dist/redux/reducers/telemetry.js +46 -0
- package/dist/redux/reducers/telemetry.js.map +1 -0
- package/dist/redux/reducers/type-owners.d.ts +5 -0
- package/dist/redux/reducers/type-owners.js +102 -0
- package/dist/redux/reducers/type-owners.js.map +1 -0
- package/dist/redux/reducers/visited-page.d.ts +2 -0
- package/dist/redux/reducers/visited-page.js +31 -0
- package/dist/redux/reducers/visited-page.js.map +1 -0
- package/dist/redux/reducers/webpack-compilation-hash.d.ts +2 -0
- package/dist/redux/reducers/webpack-compilation-hash.js +14 -0
- package/dist/redux/reducers/webpack-compilation-hash.js.map +1 -0
- package/dist/redux/reducers/webpack.d.ts +2 -0
- package/dist/redux/reducers/webpack.js +27 -0
- package/dist/redux/reducers/webpack.js.map +1 -0
- package/dist/redux/save-state.js +19 -0
- package/dist/redux/save-state.js.map +1 -0
- package/dist/redux/types.d.ts +1337 -0
- package/dist/redux/types.js +326 -0
- package/dist/redux/types.js.map +1 -0
- package/dist/schema/context.d.ts +14 -0
- package/dist/schema/context.js +38 -0
- package/dist/schema/context.js.map +1 -0
- package/dist/schema/extensions/index.js +205 -0
- package/dist/schema/extensions/index.js.map +1 -0
- package/dist/schema/graphql-engine/bootstrap.d.ts +2 -0
- package/dist/schema/graphql-engine/bootstrap.js +12 -0
- package/dist/schema/graphql-engine/bootstrap.js.map +1 -0
- package/dist/schema/graphql-engine/bundle-webpack.d.ts +5 -0
- package/dist/schema/graphql-engine/bundle-webpack.js +446 -0
- package/dist/schema/graphql-engine/bundle-webpack.js.map +1 -0
- package/dist/schema/graphql-engine/entry.d.ts +23 -0
- package/dist/schema/graphql-engine/entry.js +204 -0
- package/dist/schema/graphql-engine/entry.js.map +1 -0
- package/dist/schema/graphql-engine/lmdb-bundling-patch.d.ts +1 -0
- package/dist/schema/graphql-engine/lmdb-bundling-patch.js +72 -0
- package/dist/schema/graphql-engine/lmdb-bundling-patch.js.map +1 -0
- package/dist/schema/graphql-engine/platform-and-arch-check.d.ts +0 -0
- package/dist/schema/graphql-engine/platform-and-arch-check.js +6 -0
- package/dist/schema/graphql-engine/platform-and-arch-check.js.map +1 -0
- package/dist/schema/graphql-engine/print-plugins.d.ts +2 -0
- package/dist/schema/graphql-engine/print-plugins.js +145 -0
- package/dist/schema/graphql-engine/print-plugins.js.map +1 -0
- package/dist/schema/graphql-engine/sharp-bundling-patch.d.ts +1 -0
- package/dist/schema/graphql-engine/sharp-bundling-patch.js +8 -0
- package/dist/schema/graphql-engine/sharp-bundling-patch.js.map +1 -0
- package/dist/schema/graphql-engine/shims/gatsby-sharp.js +10 -0
- package/dist/schema/graphql-engine/shims/gatsby-sharp.js.map +1 -0
- package/dist/schema/graphql-engine/shims/no-op-module.js +3 -0
- package/dist/schema/graphql-engine/shims/no-op-module.js.map +1 -0
- package/dist/schema/graphql-engine/shims/ts-node.js +17 -0
- package/dist/schema/graphql-engine/shims/ts-node.js.map +1 -0
- package/dist/schema/graphql-engine/standalone-regenerate.d.ts +2 -0
- package/dist/schema/graphql-engine/standalone-regenerate.js +73 -0
- package/dist/schema/graphql-engine/standalone-regenerate.js.map +1 -0
- package/dist/schema/index.js +189 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/infer/add-inferred-fields.js +413 -0
- package/dist/schema/infer/add-inferred-fields.js.map +1 -0
- package/dist/schema/infer/build-example-data.d.ts +5 -0
- package/dist/schema/infer/build-example-data.js +199 -0
- package/dist/schema/infer/build-example-data.js.map +1 -0
- package/dist/schema/infer/index.js +121 -0
- package/dist/schema/infer/index.js.map +1 -0
- package/dist/schema/infer/inference-metadata.d.ts +72 -0
- package/dist/schema/infer/inference-metadata.js +280 -0
- package/dist/schema/infer/inference-metadata.js.map +1 -0
- package/dist/schema/infer/is-file.d.ts +1 -0
- package/dist/schema/infer/is-file.js +65 -0
- package/dist/schema/infer/is-file.js.map +1 -0
- package/dist/schema/infer/type-conflict-reporter.d.ts +28 -0
- package/dist/schema/infer/type-conflict-reporter.js +104 -0
- package/dist/schema/infer/type-conflict-reporter.js.map +1 -0
- package/dist/schema/node-model.js +784 -0
- package/dist/schema/node-model.js.map +1 -0
- package/dist/schema/print.d.ts +20 -0
- package/dist/schema/print.js +279 -0
- package/dist/schema/print.js.map +1 -0
- package/dist/schema/resolvers.d.ts +40 -0
- package/dist/schema/resolvers.js +569 -0
- package/dist/schema/resolvers.js.map +1 -0
- package/dist/schema/schema-composer.d.ts +3 -0
- package/dist/schema/schema-composer.js +31 -0
- package/dist/schema/schema-composer.js.map +1 -0
- package/dist/schema/schema.js +1295 -0
- package/dist/schema/schema.js.map +1 -0
- package/dist/schema/type-definitions.d.ts +47 -0
- package/dist/schema/type-definitions.js +4 -0
- package/dist/schema/type-definitions.js.map +1 -0
- package/dist/schema/types/built-in-types.d.ts +5 -0
- package/dist/schema/types/built-in-types.js +139 -0
- package/dist/schema/types/built-in-types.js.map +1 -0
- package/dist/schema/types/date.d.ts +37 -0
- package/dist/schema/types/date.js +225 -0
- package/dist/schema/types/date.js.map +1 -0
- package/dist/schema/types/derived-types.d.ts +45 -0
- package/dist/schema/types/derived-types.js +108 -0
- package/dist/schema/types/derived-types.js.map +1 -0
- package/dist/schema/types/filter.d.ts +12 -0
- package/dist/schema/types/filter.js +105 -0
- package/dist/schema/types/filter.js.map +1 -0
- package/dist/schema/types/media.d.ts +2 -0
- package/dist/schema/types/media.js +10 -0
- package/dist/schema/types/media.js.map +1 -0
- package/dist/schema/types/node-interface.d.ts +14 -0
- package/dist/schema/types/node-interface.js +103 -0
- package/dist/schema/types/node-interface.js.map +1 -0
- package/dist/schema/types/pagination.d.ts +16 -0
- package/dist/schema/types/pagination.js +198 -0
- package/dist/schema/types/pagination.js.map +1 -0
- package/dist/schema/types/remote-file-interface.d.ts +3 -0
- package/dist/schema/types/remote-file-interface.js +34 -0
- package/dist/schema/types/remote-file-interface.js.map +1 -0
- package/dist/schema/types/sort.d.ts +24 -0
- package/dist/schema/types/sort.js +178 -0
- package/dist/schema/types/sort.js.map +1 -0
- package/dist/schema/types/type-builders.d.ts +36 -0
- package/dist/schema/types/type-builders.js +61 -0
- package/dist/schema/types/type-builders.js.map +1 -0
- package/dist/schema/types/type-defs.js +86 -0
- package/dist/schema/types/type-defs.js.map +1 -0
- package/dist/schema/types/utils.d.ts +33 -0
- package/dist/schema/types/utils.js +153 -0
- package/dist/schema/types/utils.js.map +1 -0
- package/dist/schema/utils.d.ts +28 -0
- package/dist/schema/utils.js +149 -0
- package/dist/schema/utils.js.map +1 -0
- package/dist/services/build-schema.d.ts +2 -0
- package/dist/services/build-schema.js +24 -0
- package/dist/services/build-schema.js.map +1 -0
- package/dist/services/calculate-dirty-queries.d.ts +5 -0
- package/dist/services/calculate-dirty-queries.js +44 -0
- package/dist/services/calculate-dirty-queries.js.map +1 -0
- package/dist/services/create-pages.d.ts +5 -0
- package/dist/services/create-pages.js +108 -0
- package/dist/services/create-pages.js.map +1 -0
- package/dist/services/customize-schema.d.ts +2 -0
- package/dist/services/customize-schema.js +26 -0
- package/dist/services/customize-schema.js.map +1 -0
- package/dist/services/extract-queries.d.ts +2 -0
- package/dist/services/extract-queries.js +24 -0
- package/dist/services/extract-queries.js.map +1 -0
- package/dist/services/graphql-typegen.d.ts +2 -0
- package/dist/services/graphql-typegen.js +46 -0
- package/dist/services/graphql-typegen.js.map +1 -0
- package/dist/services/index.d.ts +19 -0
- package/dist/services/index.js +68 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/initialize.d.ts +14 -0
- package/dist/services/initialize.js +519 -0
- package/dist/services/initialize.js.map +1 -0
- package/dist/services/listen-for-mutations.d.ts +2 -0
- package/dist/services/listen-for-mutations.js +59 -0
- package/dist/services/listen-for-mutations.js.map +1 -0
- package/dist/services/listen-to-webpack.d.ts +3 -0
- package/dist/services/listen-to-webpack.js +17 -0
- package/dist/services/listen-to-webpack.js.map +1 -0
- package/dist/services/post-bootstrap.d.ts +2 -0
- package/dist/services/post-bootstrap.js +29 -0
- package/dist/services/post-bootstrap.js.map +1 -0
- package/dist/services/recompile.d.ts +3 -0
- package/dist/services/recompile.js +67 -0
- package/dist/services/recompile.js.map +1 -0
- package/dist/services/run-mutation-batch.d.ts +2 -0
- package/dist/services/run-mutation-batch.js +12 -0
- package/dist/services/run-mutation-batch.js.map +1 -0
- package/dist/services/run-page-queries.d.ts +2 -0
- package/dist/services/run-page-queries.js +38 -0
- package/dist/services/run-page-queries.js.map +1 -0
- package/dist/services/run-slice-queries.d.ts +2 -0
- package/dist/services/run-slice-queries.js +40 -0
- package/dist/services/run-slice-queries.js.map +1 -0
- package/dist/services/run-static-queries.d.ts +2 -0
- package/dist/services/run-static-queries.js +38 -0
- package/dist/services/run-static-queries.js.map +1 -0
- package/dist/services/source-nodes.d.ts +5 -0
- package/dist/services/source-nodes.js +47 -0
- package/dist/services/source-nodes.js.map +1 -0
- package/dist/services/start-webpack-server.d.ts +9 -0
- package/dist/services/start-webpack-server.js +103 -0
- package/dist/services/start-webpack-server.js.map +1 -0
- package/dist/services/types.d.ts +53 -0
- package/dist/services/types.js +4 -0
- package/dist/services/types.js.map +1 -0
- package/dist/services/write-out-redirects.d.ts +2 -0
- package/dist/services/write-out-redirects.js +20 -0
- package/dist/services/write-out-redirects.js.map +1 -0
- package/dist/services/write-out-requires.d.ts +2 -0
- package/dist/services/write-out-requires.js +27 -0
- package/dist/services/write-out-requires.js.map +1 -0
- package/dist/state-machines/data-layer/actions.d.ts +11 -0
- package/dist/state-machines/data-layer/actions.js +38 -0
- package/dist/state-machines/data-layer/actions.js.map +1 -0
- package/dist/state-machines/data-layer/index.d.ts +24 -0
- package/dist/state-machines/data-layer/index.js +152 -0
- package/dist/state-machines/data-layer/index.js.map +1 -0
- package/dist/state-machines/data-layer/services.d.ts +3 -0
- package/dist/state-machines/data-layer/services.js +14 -0
- package/dist/state-machines/data-layer/services.js.map +1 -0
- package/dist/state-machines/data-layer/types.d.ts +27 -0
- package/dist/state-machines/data-layer/types.js +4 -0
- package/dist/state-machines/data-layer/types.js.map +1 -0
- package/dist/state-machines/develop/actions.d.ts +68 -0
- package/dist/state-machines/develop/actions.js +259 -0
- package/dist/state-machines/develop/actions.js.map +1 -0
- package/dist/state-machines/develop/index.d.ts +5 -0
- package/dist/state-machines/develop/index.js +372 -0
- package/dist/state-machines/develop/index.js.map +1 -0
- package/dist/state-machines/develop/services.d.ts +3 -0
- package/dist/state-machines/develop/services.js +22 -0
- package/dist/state-machines/develop/services.js.map +1 -0
- package/dist/state-machines/index.d.ts +7 -0
- package/dist/state-machines/index.js +21 -0
- package/dist/state-machines/index.js.map +1 -0
- package/dist/state-machines/query-running/actions.d.ts +9 -0
- package/dist/state-machines/query-running/actions.js +55 -0
- package/dist/state-machines/query-running/actions.js.map +1 -0
- package/dist/state-machines/query-running/index.d.ts +7 -0
- package/dist/state-machines/query-running/index.js +142 -0
- package/dist/state-machines/query-running/index.js.map +1 -0
- package/dist/state-machines/query-running/services.d.ts +3 -0
- package/dist/state-machines/query-running/services.js +17 -0
- package/dist/state-machines/query-running/services.js.map +1 -0
- package/dist/state-machines/query-running/types.d.ts +26 -0
- package/dist/state-machines/query-running/types.js +4 -0
- package/dist/state-machines/query-running/types.js.map +1 -0
- package/dist/state-machines/waiting/actions.d.ts +11 -0
- package/dist/state-machines/waiting/actions.js +36 -0
- package/dist/state-machines/waiting/actions.js.map +1 -0
- package/dist/state-machines/waiting/index.d.ts +12 -0
- package/dist/state-machines/waiting/index.js +145 -0
- package/dist/state-machines/waiting/index.js.map +1 -0
- package/dist/state-machines/waiting/services.d.ts +3 -0
- package/dist/state-machines/waiting/services.js +10 -0
- package/dist/state-machines/waiting/services.js.map +1 -0
- package/dist/state-machines/waiting/types.d.ts +12 -0
- package/dist/state-machines/waiting/types.js +4 -0
- package/dist/state-machines/waiting/types.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/adapter/constants.d.ts +5 -0
- package/dist/utils/adapter/constants.js +31 -0
- package/dist/utils/adapter/constants.js.map +1 -0
- package/dist/utils/adapter/create-headers.d.ts +10 -0
- package/dist/utils/adapter/create-headers.js +94 -0
- package/dist/utils/adapter/create-headers.js.map +1 -0
- package/dist/utils/adapter/get-route-path.d.ts +3 -0
- package/dist/utils/adapter/get-route-path.js +22 -0
- package/dist/utils/adapter/get-route-path.js.map +1 -0
- package/dist/utils/adapter/init.d.ts +3 -0
- package/dist/utils/adapter/init.js +183 -0
- package/dist/utils/adapter/init.js.map +1 -0
- package/dist/utils/adapter/manager.d.ts +9 -0
- package/dist/utils/adapter/manager.js +554 -0
- package/dist/utils/adapter/manager.js.map +1 -0
- package/dist/utils/adapter/no-op-manager.d.ts +2 -0
- package/dist/utils/adapter/no-op-manager.js +18 -0
- package/dist/utils/adapter/no-op-manager.js.map +1 -0
- package/dist/utils/adapter/types.d.ts +282 -0
- package/dist/utils/adapter/types.js +4 -0
- package/dist/utils/adapter/types.js.map +1 -0
- package/dist/utils/api-browser-docs.d.ts +272 -0
- package/dist/utils/api-browser-docs.js +318 -0
- package/dist/utils/api-browser-docs.js.map +1 -0
- package/dist/utils/api-node-docs.d.ts +470 -0
- package/dist/utils/api-node-docs.js +519 -0
- package/dist/utils/api-node-docs.js.map +1 -0
- package/dist/utils/api-node-helpers-docs.js +322 -0
- package/dist/utils/api-node-helpers-docs.js.map +1 -0
- package/dist/utils/api-runner-error-parser.d.ts +5 -0
- package/dist/utils/api-runner-error-parser.js +63 -0
- package/dist/utils/api-runner-error-parser.js.map +1 -0
- package/dist/utils/api-runner-node.js +663 -0
- package/dist/utils/api-runner-node.js.map +1 -0
- package/dist/utils/app-data.d.ts +2 -0
- package/dist/utils/app-data.js +15 -0
- package/dist/utils/app-data.js.map +1 -0
- package/dist/utils/assert-store.d.ts +2 -0
- package/dist/utils/assert-store.js +12 -0
- package/dist/utils/assert-store.js.map +1 -0
- package/dist/utils/babel/babel-module-exports-helpers.d.ts +22 -0
- package/dist/utils/babel/babel-module-exports-helpers.js +48 -0
- package/dist/utils/babel/babel-module-exports-helpers.js.map +1 -0
- package/dist/utils/babel/babel-plugin-add-slice-placeholder-location.d.ts +10 -0
- package/dist/utils/babel/babel-plugin-add-slice-placeholder-location.js +48 -0
- package/dist/utils/babel/babel-plugin-add-slice-placeholder-location.js.map +1 -0
- package/dist/utils/babel/babel-plugin-remove-api.d.ts +5 -0
- package/dist/utils/babel/babel-plugin-remove-api.js +148 -0
- package/dist/utils/babel/babel-plugin-remove-api.js.map +1 -0
- package/dist/utils/babel/find-slices.d.ts +8 -0
- package/dist/utils/babel/find-slices.js +68 -0
- package/dist/utils/babel/find-slices.js.map +1 -0
- package/dist/utils/babel-loader-helpers.d.ts +19 -0
- package/dist/utils/babel-loader-helpers.js +158 -0
- package/dist/utils/babel-loader-helpers.js.map +1 -0
- package/dist/utils/babel-loader.d.ts +8 -0
- package/dist/utils/babel-loader.js +158 -0
- package/dist/utils/babel-loader.js.map +1 -0
- package/dist/utils/babel-parse-to-ast.d.ts +4 -0
- package/dist/utils/babel-parse-to-ast.js +34 -0
- package/dist/utils/babel-parse-to-ast.js.map +1 -0
- package/dist/utils/batcher.d.ts +15 -0
- package/dist/utils/batcher.js +46 -0
- package/dist/utils/batcher.js.map +1 -0
- package/dist/utils/browserslist.d.ts +2 -0
- package/dist/utils/browserslist.js +38 -0
- package/dist/utils/browserslist.js.map +1 -0
- package/dist/utils/cache-lmdb.d.ts +19 -0
- package/dist/utils/cache-lmdb.js +88 -0
- package/dist/utils/cache-lmdb.js.map +1 -0
- package/dist/utils/cache.d.ts +17 -0
- package/dist/utils/cache.js +77 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/call-deferred-api.d.ts +8 -0
- package/dist/utils/call-deferred-api.js +35 -0
- package/dist/utils/call-deferred-api.js.map +1 -0
- package/dist/utils/changed-pages.d.ts +6 -0
- package/dist/utils/changed-pages.js +45 -0
- package/dist/utils/changed-pages.js.map +1 -0
- package/dist/utils/clear-require-cache.d.ts +1 -0
- package/dist/utils/clear-require-cache.js +24 -0
- package/dist/utils/clear-require-cache.js.map +1 -0
- package/dist/utils/client-assets-for-template.d.ts +9 -0
- package/dist/utils/client-assets-for-template.js +141 -0
- package/dist/utils/client-assets-for-template.js.map +1 -0
- package/dist/utils/create-node-id.d.ts +24 -0
- package/dist/utils/create-node-id.js +67 -0
- package/dist/utils/create-node-id.js.map +1 -0
- package/dist/utils/create-schema-customization.d.ts +6 -0
- package/dist/utils/create-schema-customization.js +25 -0
- package/dist/utils/create-schema-customization.js.map +1 -0
- package/dist/utils/detect-node-mutations.d.ts +4 -0
- package/dist/utils/detect-node-mutations.js +134 -0
- package/dist/utils/detect-node-mutations.js.map +1 -0
- package/dist/utils/detect-port-in-use-and-prompt.d.ts +1 -0
- package/dist/utils/detect-port-in-use-and-prompt.js +31 -0
- package/dist/utils/detect-port-in-use-and-prompt.js.map +1 -0
- package/dist/utils/dev-ssr/parse-error.d.ts +22 -0
- package/dist/utils/dev-ssr/parse-error.js +119 -0
- package/dist/utils/dev-ssr/parse-error.js.map +1 -0
- package/dist/utils/dev-ssr/render-dev-html-child.d.ts +13 -0
- package/dist/utils/dev-ssr/render-dev-html-child.js +47 -0
- package/dist/utils/dev-ssr/render-dev-html-child.js.map +1 -0
- package/dist/utils/dev-ssr/render-dev-html.d.ts +23 -0
- package/dist/utils/dev-ssr/render-dev-html.js +227 -0
- package/dist/utils/dev-ssr/render-dev-html.js.map +1 -0
- package/dist/utils/develop-preload-headers.d.ts +7 -0
- package/dist/utils/develop-preload-headers.js +64 -0
- package/dist/utils/develop-preload-headers.js.map +1 -0
- package/dist/utils/did-you-mean.d.ts +3 -0
- package/dist/utils/did-you-mean.js +21 -0
- package/dist/utils/did-you-mean.js.map +1 -0
- package/dist/utils/engine-context.d.ts +5 -0
- package/dist/utils/engine-context.js +19 -0
- package/dist/utils/engine-context.js.map +1 -0
- package/dist/utils/engines-fs-provider.d.ts +9 -0
- package/dist/utils/engines-fs-provider.js +24 -0
- package/dist/utils/engines-fs-provider.js.map +1 -0
- package/dist/utils/engines-helpers.d.ts +10 -0
- package/dist/utils/engines-helpers.js +48 -0
- package/dist/utils/engines-helpers.js.map +1 -0
- package/dist/utils/ensure-file-content.d.ts +1 -0
- package/dist/utils/ensure-file-content.js +19 -0
- package/dist/utils/ensure-file-content.js.map +1 -0
- package/dist/utils/eslint/required.js +10 -0
- package/dist/utils/eslint/required.js.map +1 -0
- package/dist/utils/eslint-config.d.ts +3 -0
- package/dist/utils/eslint-config.js +136 -0
- package/dist/utils/eslint-config.js.map +1 -0
- package/dist/utils/eslint-rules/limited-exports-page-templates.d.ts +1 -0
- package/dist/utils/eslint-rules/limited-exports-page-templates.js +183 -0
- package/dist/utils/eslint-rules/limited-exports-page-templates.js.map +1 -0
- package/dist/utils/eslint-rules/no-anonymous-exports-page-templates.d.ts +1 -0
- package/dist/utils/eslint-rules/no-anonymous-exports-page-templates.js +75 -0
- package/dist/utils/eslint-rules/no-anonymous-exports-page-templates.js.map +1 -0
- package/dist/utils/eslint-rules-helpers.d.ts +4 -0
- package/dist/utils/eslint-rules-helpers.js +22 -0
- package/dist/utils/eslint-rules-helpers.js.map +1 -0
- package/dist/utils/express-middlewares.d.ts +4 -0
- package/dist/utils/express-middlewares.js +57 -0
- package/dist/utils/express-middlewares.js.map +1 -0
- package/dist/utils/extract-undefined-global.d.ts +4 -0
- package/dist/utils/extract-undefined-global.js +15 -0
- package/dist/utils/extract-undefined-global.js.map +1 -0
- package/dist/utils/fast-refresh-module.d.ts +22 -0
- package/dist/utils/fast-refresh-module.js +53 -0
- package/dist/utils/fast-refresh-module.js.map +1 -0
- package/dist/utils/feedback.d.ts +5 -0
- package/dist/utils/feedback.js +159 -0
- package/dist/utils/feedback.js.map +1 -0
- package/dist/utils/find-page-by-path.d.ts +2 -0
- package/dist/utils/find-page-by-path.js +96 -0
- package/dist/utils/find-page-by-path.js.map +1 -0
- package/dist/utils/flags.d.ts +41 -0
- package/dist/utils/flags.js +92 -0
- package/dist/utils/flags.js.map +1 -0
- package/dist/utils/gatsby-cloud-config.d.ts +4 -0
- package/dist/utils/gatsby-cloud-config.js +15 -0
- package/dist/utils/gatsby-cloud-config.js.map +1 -0
- package/dist/utils/gatsby-dependents.d.ts +8 -0
- package/dist/utils/gatsby-dependents.js +51 -0
- package/dist/utils/gatsby-dependents.js.map +1 -0
- package/dist/utils/gatsby-webpack-stats-extractor.d.ts +7 -0
- package/dist/utils/gatsby-webpack-stats-extractor.js +136 -0
- package/dist/utils/gatsby-webpack-stats-extractor.js.map +1 -0
- package/dist/utils/gatsby-webpack-virtual-modules.d.ts +6 -0
- package/dist/utils/gatsby-webpack-virtual-modules.js +45 -0
- package/dist/utils/gatsby-webpack-virtual-modules.js.map +1 -0
- package/dist/utils/get-cache.d.ts +2 -0
- package/dist/utils/get-cache.js +18 -0
- package/dist/utils/get-cache.js.map +1 -0
- package/dist/utils/get-latest-gatsby-files.d.ts +8 -0
- package/dist/utils/get-latest-gatsby-files.js +93 -0
- package/dist/utils/get-latest-gatsby-files.js.map +1 -0
- package/dist/utils/get-page-data.d.ts +3 -0
- package/dist/utils/get-page-data.js +88 -0
- package/dist/utils/get-page-data.js.map +1 -0
- package/dist/utils/get-public-path.d.ts +5 -0
- package/dist/utils/get-public-path.js +19 -0
- package/dist/utils/get-public-path.js.map +1 -0
- package/dist/utils/get-server-data.d.ts +19 -0
- package/dist/utils/get-server-data.js +29 -0
- package/dist/utils/get-server-data.js.map +1 -0
- package/dist/utils/get-ssl-cert.d.ts +9 -0
- package/dist/utils/get-ssl-cert.js +95 -0
- package/dist/utils/get-ssl-cert.js.map +1 -0
- package/dist/utils/get-static-dir.d.ts +12 -0
- package/dist/utils/get-static-dir.js +60 -0
- package/dist/utils/get-static-dir.js.map +1 -0
- package/dist/utils/get-value-at.d.ts +1 -0
- package/dist/utils/get-value-at.js +22 -0
- package/dist/utils/get-value-at.js.map +1 -0
- package/dist/utils/graphql-typegen/file-writes.d.ts +5 -0
- package/dist/utils/graphql-typegen/file-writes.js +63 -0
- package/dist/utils/graphql-typegen/file-writes.js.map +1 -0
- package/dist/utils/graphql-typegen/ts-codegen.d.ts +5 -0
- package/dist/utils/graphql-typegen/ts-codegen.js +136 -0
- package/dist/utils/graphql-typegen/ts-codegen.js.map +1 -0
- package/dist/utils/graphql-typegen/utils.d.ts +11 -0
- package/dist/utils/graphql-typegen/utils.js +70 -0
- package/dist/utils/graphql-typegen/utils.js.map +1 -0
- package/dist/utils/handle-flags.d.ts +8 -0
- package/dist/utils/handle-flags.js +212 -0
- package/dist/utils/handle-flags.js.map +1 -0
- package/dist/utils/import-gatsby-plugin.d.ts +11 -0
- package/dist/utils/import-gatsby-plugin.js +40 -0
- package/dist/utils/import-gatsby-plugin.js.map +1 -0
- package/dist/utils/is-32-bit-integer.d.ts +1 -0
- package/dist/utils/is-32-bit-integer.js +8 -0
- package/dist/utils/is-32-bit-integer.js.map +1 -0
- package/dist/utils/is-near-match.d.ts +1 -0
- package/dist/utils/is-near-match.js +10 -0
- package/dist/utils/is-near-match.js.map +1 -0
- package/dist/utils/jobs/manager.d.ts +34 -0
- package/dist/utils/jobs/manager.js +313 -0
- package/dist/utils/jobs/manager.js.map +1 -0
- package/dist/utils/jobs/types.d.ts +63 -0
- package/dist/utils/jobs/types.js +32 -0
- package/dist/utils/jobs/types.js.map +1 -0
- package/dist/utils/jobs/worker-messaging.d.ts +10 -0
- package/dist/utils/jobs/worker-messaging.js +114 -0
- package/dist/utils/jobs/worker-messaging.js.map +1 -0
- package/dist/utils/js-chunk-names.d.ts +1 -0
- package/dist/utils/js-chunk-names.js +72 -0
- package/dist/utils/js-chunk-names.js.map +1 -0
- package/dist/utils/loading-indicator.d.ts +3 -0
- package/dist/utils/loading-indicator.js +44 -0
- package/dist/utils/loading-indicator.js.map +1 -0
- package/dist/utils/local-eslint-config-finder.d.ts +1 -0
- package/dist/utils/local-eslint-config-finder.js +31 -0
- package/dist/utils/local-eslint-config-finder.js.map +1 -0
- package/dist/utils/merge-gatsby-config.d.ts +28 -0
- package/dist/utils/merge-gatsby-config.js +43 -0
- package/dist/utils/merge-gatsby-config.js.map +1 -0
- package/dist/utils/mett.d.ts +10 -0
- package/dist/utils/mett.js +42 -0
- package/dist/utils/mett.js.map +1 -0
- package/dist/utils/module-resolver.d.ts +2 -0
- package/dist/utils/module-resolver.js +24 -0
- package/dist/utils/module-resolver.js.map +1 -0
- package/dist/utils/node-manifest.d.ts +46 -0
- package/dist/utils/node-manifest.js +367 -0
- package/dist/utils/node-manifest.js.map +1 -0
- package/dist/utils/nodes.d.ts +13 -0
- package/dist/utils/nodes.js +62 -0
- package/dist/utils/nodes.js.map +1 -0
- package/dist/utils/normalize-path.d.ts +2 -0
- package/dist/utils/normalize-path.js +11 -0
- package/dist/utils/normalize-path.js.map +1 -0
- package/dist/utils/page-data-helpers.d.ts +23 -0
- package/dist/utils/page-data-helpers.js +76 -0
- package/dist/utils/page-data-helpers.js.map +1 -0
- package/dist/utils/page-data.d.ts +39 -0
- package/dist/utils/page-data.js +366 -0
- package/dist/utils/page-data.js.map +1 -0
- package/dist/utils/page-mode.d.ts +18 -0
- package/dist/utils/page-mode.js +124 -0
- package/dist/utils/page-mode.js.map +1 -0
- package/dist/utils/page-ssr-module/bundle-webpack.d.ts +18 -0
- package/dist/utils/page-ssr-module/bundle-webpack.js +209 -0
- package/dist/utils/page-ssr-module/bundle-webpack.js.map +1 -0
- package/dist/utils/page-ssr-module/entry.d.ts +61 -0
- package/dist/utils/page-ssr-module/entry.js +344 -0
- package/dist/utils/page-ssr-module/entry.js.map +1 -0
- package/dist/utils/page-ssr-module/lambda.d.ts +3 -0
- package/dist/utils/page-ssr-module/lambda.js +401 -0
- package/dist/utils/page-ssr-module/lambda.js.map +1 -0
- package/dist/utils/parcel/compile-gatsby-files.d.ts +26 -0
- package/dist/utils/parcel/compile-gatsby-files.js +271 -0
- package/dist/utils/parcel/compile-gatsby-files.js.map +1 -0
- package/dist/utils/path.d.ts +5 -0
- package/dist/utils/path.js +55 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/prepare-regex.d.ts +1 -0
- package/dist/utils/prepare-regex.js +13 -0
- package/dist/utils/prepare-regex.js.map +1 -0
- package/dist/utils/prepare-urls.d.ts +7 -0
- package/dist/utils/prepare-urls.js +58 -0
- package/dist/utils/prepare-urls.js.map +1 -0
- package/dist/utils/print-instructions.d.ts +2 -0
- package/dist/utils/print-instructions.js +42 -0
- package/dist/utils/print-instructions.js.map +1 -0
- package/dist/utils/rank-route.d.ts +1 -0
- package/dist/utils/rank-route.js +26 -0
- package/dist/utils/rank-route.js.map +1 -0
- package/dist/utils/reach-router-add-basecontext-export-loader.d.ts +1 -0
- package/dist/utils/reach-router-add-basecontext-export-loader.js +23 -0
- package/dist/utils/reach-router-add-basecontext-export-loader.js.map +1 -0
- package/dist/utils/report-once.d.ts +1 -0
- package/dist/utils/report-once.js +17 -0
- package/dist/utils/report-once.js.map +1 -0
- package/dist/utils/sanitize-node.d.ts +12 -0
- package/dist/utils/sanitize-node.js +87 -0
- package/dist/utils/sanitize-node.js.map +1 -0
- package/dist/utils/show-experiment-notice.d.ts +6 -0
- package/dist/utils/show-experiment-notice.js +51 -0
- package/dist/utils/show-experiment-notice.js.map +1 -0
- package/dist/utils/slices/stitching.d.ts +4 -0
- package/dist/utils/slices/stitching.js +92 -0
- package/dist/utils/slices/stitching.js.map +1 -0
- package/dist/utils/slices.d.ts +2 -0
- package/dist/utils/slices.js +9 -0
- package/dist/utils/slices.js.map +1 -0
- package/dist/utils/source-nodes-api-runner.d.ts +8 -0
- package/dist/utils/source-nodes-api-runner.js +23 -0
- package/dist/utils/source-nodes-api-runner.js.map +1 -0
- package/dist/utils/source-nodes.d.ts +11 -0
- package/dist/utils/source-nodes.js +150 -0
- package/dist/utils/source-nodes.js.map +1 -0
- package/dist/utils/stack-trace-utils.d.ts +24 -0
- package/dist/utils/stack-trace-utils.js +113 -0
- package/dist/utils/stack-trace-utils.js.map +1 -0
- package/dist/utils/start-server.d.ts +22 -0
- package/dist/utils/start-server.js +722 -0
- package/dist/utils/start-server.js.map +1 -0
- package/dist/utils/state-machine-logging.d.ts +4 -0
- package/dist/utils/state-machine-logging.js +47 -0
- package/dist/utils/state-machine-logging.js.map +1 -0
- package/dist/utils/static-query-utils.d.ts +13 -0
- package/dist/utils/static-query-utils.js +57 -0
- package/dist/utils/static-query-utils.js.map +1 -0
- package/dist/utils/test-import-error.d.ts +1 -0
- package/dist/utils/test-import-error.js +18 -0
- package/dist/utils/test-import-error.js.map +1 -0
- package/dist/utils/tracer/index.d.ts +12 -0
- package/dist/utils/tracer/index.js +42 -0
- package/dist/utils/tracer/index.js.map +1 -0
- package/dist/utils/tracer/jaeger-local.d.ts +4 -0
- package/dist/utils/tracer/jaeger-local.js +32 -0
- package/dist/utils/tracer/jaeger-local.js.map +1 -0
- package/dist/utils/tracer/zipkin-local.d.ts +11 -0
- package/dist/utils/tracer/zipkin-local.js +87 -0
- package/dist/utils/tracer/zipkin-local.js.map +1 -0
- package/dist/utils/tracer/zipkin-types.d.js +14 -0
- package/dist/utils/tracer/zipkin-types.d.js.map +1 -0
- package/dist/utils/validate-component.d.ts +23 -0
- package/dist/utils/validate-component.js +99 -0
- package/dist/utils/validate-component.js.map +1 -0
- package/dist/utils/validate-engines/child.d.ts +1 -0
- package/dist/utils/validate-engines/child.js +74 -0
- package/dist/utils/validate-engines/child.js.map +1 -0
- package/dist/utils/validate-engines/index.d.ts +2 -0
- package/dist/utils/validate-engines/index.js +48 -0
- package/dist/utils/validate-engines/index.js.map +1 -0
- package/dist/utils/wait-until-jobs-complete.d.ts +2 -0
- package/dist/utils/wait-until-jobs-complete.js +30 -0
- package/dist/utils/wait-until-jobs-complete.js.map +1 -0
- package/dist/utils/webpack/bundle.d.ts +9 -0
- package/dist/utils/webpack/bundle.js +41 -0
- package/dist/utils/webpack/bundle.js.map +1 -0
- package/dist/utils/webpack/get-ssr-chunk-hashes.d.ts +9 -0
- package/dist/utils/webpack/get-ssr-chunk-hashes.js +55 -0
- package/dist/utils/webpack/get-ssr-chunk-hashes.js.map +1 -0
- package/dist/utils/webpack/loaders/client-components-requires-writer-loader.d.ts +1 -0
- package/dist/utils/webpack/loaders/client-components-requires-writer-loader.js +22 -0
- package/dist/utils/webpack/loaders/client-components-requires-writer-loader.js.map +1 -0
- package/dist/utils/webpack/loaders/partial-hydration-reference-loader.d.ts +1 -0
- package/dist/utils/webpack/loaders/partial-hydration-reference-loader.js +127 -0
- package/dist/utils/webpack/loaders/partial-hydration-reference-loader.js.map +1 -0
- package/dist/utils/webpack/loaders/webpack-remove-exports-loader.d.ts +1 -0
- package/dist/utils/webpack/loaders/webpack-remove-exports-loader.js +40 -0
- package/dist/utils/webpack/loaders/webpack-remove-exports-loader.js.map +1 -0
- package/dist/utils/webpack/plugins/cache-folder-resolver.d.ts +25 -0
- package/dist/utils/webpack/plugins/cache-folder-resolver.js +111 -0
- package/dist/utils/webpack/plugins/cache-folder-resolver.js.map +1 -0
- package/dist/utils/webpack/plugins/corejs-resolver.d.ts +12 -0
- package/dist/utils/webpack/plugins/corejs-resolver.js +66 -0
- package/dist/utils/webpack/plugins/corejs-resolver.js.map +1 -0
- package/dist/utils/webpack/plugins/force-css-hmr-for-edge-cases.d.ts +22 -0
- package/dist/utils/webpack/plugins/force-css-hmr-for-edge-cases.js +88 -0
- package/dist/utils/webpack/plugins/force-css-hmr-for-edge-cases.js.map +1 -0
- package/dist/utils/webpack/plugins/partial-hydration.d.ts +26 -0
- package/dist/utils/webpack/plugins/partial-hydration.js +362 -0
- package/dist/utils/webpack/plugins/partial-hydration.js.map +1 -0
- package/dist/utils/webpack/plugins/static-query-mapper.d.ts +13 -0
- package/dist/utils/webpack/plugins/static-query-mapper.js +235 -0
- package/dist/utils/webpack/plugins/static-query-mapper.js.map +1 -0
- package/dist/utils/webpack/plugins/webpack-logging.d.ts +12 -0
- package/dist/utils/webpack/plugins/webpack-logging.js +51 -0
- package/dist/utils/webpack/plugins/webpack-logging.js.map +1 -0
- package/dist/utils/webpack/utils/create-normalized-module-key.d.ts +12 -0
- package/dist/utils/webpack/utils/create-normalized-module-key.js +25 -0
- package/dist/utils/webpack/utils/create-normalized-module-key.js.map +1 -0
- package/dist/utils/webpack/utils/is-file-inside-compilations.d.ts +7 -0
- package/dist/utils/webpack/utils/is-file-inside-compilations.js +37 -0
- package/dist/utils/webpack/utils/is-file-inside-compilations.js.map +1 -0
- package/dist/utils/webpack-error-utils.d.ts +24 -0
- package/dist/utils/webpack-error-utils.js +112 -0
- package/dist/utils/webpack-error-utils.js.map +1 -0
- package/dist/utils/webpack-plugins.d.ts +46 -0
- package/dist/utils/webpack-plugins.js +61 -0
- package/dist/utils/webpack-plugins.js.map +1 -0
- package/dist/utils/webpack-status.d.ts +3 -0
- package/dist/utils/webpack-status.js +21 -0
- package/dist/utils/webpack-status.js.map +1 -0
- package/dist/utils/webpack-utils.d.ts +121 -0
- package/dist/utils/webpack-utils.js +574 -0
- package/dist/utils/webpack-utils.js.map +1 -0
- package/dist/utils/webpack.config.js +804 -0
- package/dist/utils/webpack.config.js.map +1 -0
- package/dist/utils/websocket-manager.d.ts +39 -0
- package/dist/utils/websocket-manager.js +183 -0
- package/dist/utils/websocket-manager.js.map +1 -0
- package/dist/utils/worker/child/index.d.ts +5 -0
- package/dist/utils/worker/child/index.js +35 -0
- package/dist/utils/worker/child/index.js.map +1 -0
- package/dist/utils/worker/child/load-config-and-plugins.d.ts +2 -0
- package/dist/utils/worker/child/load-config-and-plugins.js +28 -0
- package/dist/utils/worker/child/load-config-and-plugins.js.map +1 -0
- package/dist/utils/worker/child/queries.d.ts +7 -0
- package/dist/utils/worker/child/queries.js +84 -0
- package/dist/utils/worker/child/queries.js.map +1 -0
- package/dist/utils/worker/child/render-html.d.ts +49 -0
- package/dist/utils/worker/child/render-html.js +562 -0
- package/dist/utils/worker/child/render-html.js.map +1 -0
- package/dist/utils/worker/child/schema.d.ts +2 -0
- package/dist/utils/worker/child/schema.js +41 -0
- package/dist/utils/worker/child/schema.js.map +1 -0
- package/dist/utils/worker/child/state.d.ts +2 -0
- package/dist/utils/worker/child/state.js +13 -0
- package/dist/utils/worker/child/state.js.map +1 -0
- package/dist/utils/worker/messaging.d.ts +16 -0
- package/dist/utils/worker/messaging.js +9 -0
- package/dist/utils/worker/messaging.js.map +1 -0
- package/dist/utils/worker/pool.d.ts +10 -0
- package/dist/utils/worker/pool.js +122 -0
- package/dist/utils/worker/pool.js.map +1 -0
- package/dist/utils/worker/reporter.d.ts +3 -0
- package/dist/utils/worker/reporter.js +26 -0
- package/dist/utils/worker/reporter.js.map +1 -0
- package/dist/utils/worker/types.d.ts +3 -0
- package/dist/utils/worker/types.js +4 -0
- package/dist/utils/worker/types.js.map +1 -0
- package/graphql.d.ts +2 -0
- package/graphql.js +6 -0
- package/index.d.ts +1906 -0
- package/internal.d.ts +4 -0
- package/internal.js +5 -0
- package/ipc.json +3 -0
- package/package.json +744 -0
- package/reporter.d.ts +4 -0
- package/reporter.js +3 -0
- package/scripts/postinstall.js +7 -0
- package/utils.js +1 -0
- package/webpack.d.ts +3 -0
- package/webpack.js +3 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _isFile = require("./is-file");
|
|
4
|
+
var _date = require("../types/date");
|
|
5
|
+
var _derivedTypes = require("../types/derived-types");
|
|
6
|
+
var _reportOnce = require("../../utils/report-once");
|
|
7
|
+
var _is32BitInteger = require("../../utils/is-32-bit-integer");
|
|
8
|
+
const _ = require(`lodash`);
|
|
9
|
+
const {
|
|
10
|
+
ObjectTypeComposer
|
|
11
|
+
} = require(`graphql-compose`);
|
|
12
|
+
const {
|
|
13
|
+
GraphQLList
|
|
14
|
+
} = require(`graphql`);
|
|
15
|
+
const invariant = require(`invariant`);
|
|
16
|
+
const report = require(`gatsby-cli/lib/reporter`);
|
|
17
|
+
const {
|
|
18
|
+
getDataStore
|
|
19
|
+
} = require(`../../datastore`);
|
|
20
|
+
const addInferredFields = ({
|
|
21
|
+
schemaComposer,
|
|
22
|
+
typeComposer,
|
|
23
|
+
exampleValue,
|
|
24
|
+
typeMapping
|
|
25
|
+
}) => {
|
|
26
|
+
const config = getInferenceConfig({
|
|
27
|
+
typeComposer,
|
|
28
|
+
defaults: {
|
|
29
|
+
shouldAddFields: true
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
addInferredFieldsImpl({
|
|
33
|
+
schemaComposer,
|
|
34
|
+
typeComposer,
|
|
35
|
+
exampleObject: exampleValue,
|
|
36
|
+
prefix: typeComposer.getTypeName(),
|
|
37
|
+
unsanitizedFieldPath: [typeComposer.getTypeName()],
|
|
38
|
+
typeMapping,
|
|
39
|
+
config
|
|
40
|
+
});
|
|
41
|
+
if (deprecatedNodeKeys.size > 0) {
|
|
42
|
+
const plugin = typeComposer.getExtension(`plugin`);
|
|
43
|
+
(0, _reportOnce.reportOnce)(`Plugin "${plugin}" is using the ___NODE convention which is deprecated. This plugin should use the @link directive instead.\nMigration: https://gatsby.dev/node-convention-deprecation`, `verbose`);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
module.exports = {
|
|
47
|
+
addInferredFields
|
|
48
|
+
};
|
|
49
|
+
const addInferredFieldsImpl = ({
|
|
50
|
+
schemaComposer,
|
|
51
|
+
typeComposer,
|
|
52
|
+
exampleObject,
|
|
53
|
+
typeMapping,
|
|
54
|
+
prefix,
|
|
55
|
+
unsanitizedFieldPath,
|
|
56
|
+
config
|
|
57
|
+
}) => {
|
|
58
|
+
const fields = [];
|
|
59
|
+
Object.keys(exampleObject).forEach(unsanitizedKey => {
|
|
60
|
+
const key = createFieldName(unsanitizedKey);
|
|
61
|
+
fields.push({
|
|
62
|
+
key,
|
|
63
|
+
unsanitizedKey,
|
|
64
|
+
exampleValue: exampleObject[unsanitizedKey]
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
const fieldsByKey = _.groupBy(fields, field => field.key);
|
|
68
|
+
Object.keys(fieldsByKey).forEach(key => {
|
|
69
|
+
const possibleFields = fieldsByKey[key];
|
|
70
|
+
let selectedField;
|
|
71
|
+
if (possibleFields.length > 1) {
|
|
72
|
+
const field = resolveMultipleFields(possibleFields);
|
|
73
|
+
const possibleFieldsNames = possibleFields.map(field => `\`${field.unsanitizedKey}\``).join(`, `);
|
|
74
|
+
report.warn(`Multiple node fields resolve to the same GraphQL field \`${prefix}.${field.key}\` - [${possibleFieldsNames}]. Gatsby will use \`${field.unsanitizedKey}\`.`);
|
|
75
|
+
selectedField = field;
|
|
76
|
+
} else {
|
|
77
|
+
selectedField = possibleFields[0];
|
|
78
|
+
}
|
|
79
|
+
const fieldConfig = getFieldConfig({
|
|
80
|
+
...selectedField,
|
|
81
|
+
schemaComposer,
|
|
82
|
+
typeComposer,
|
|
83
|
+
prefix,
|
|
84
|
+
unsanitizedFieldPath,
|
|
85
|
+
typeMapping,
|
|
86
|
+
config
|
|
87
|
+
});
|
|
88
|
+
if (!fieldConfig) return;
|
|
89
|
+
if (!typeComposer.hasField(key)) {
|
|
90
|
+
if (config.shouldAddFields) {
|
|
91
|
+
typeComposer.addFields({
|
|
92
|
+
[key]: fieldConfig
|
|
93
|
+
});
|
|
94
|
+
typeComposer.setFieldExtension(key, `createdFrom`, `inference`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return typeComposer;
|
|
99
|
+
};
|
|
100
|
+
const deprecatedNodeKeys = new Set();
|
|
101
|
+
const getFieldConfig = ({
|
|
102
|
+
schemaComposer,
|
|
103
|
+
typeComposer,
|
|
104
|
+
prefix,
|
|
105
|
+
exampleValue,
|
|
106
|
+
key,
|
|
107
|
+
unsanitizedKey,
|
|
108
|
+
unsanitizedFieldPath,
|
|
109
|
+
typeMapping,
|
|
110
|
+
config
|
|
111
|
+
}) => {
|
|
112
|
+
const selector = `${prefix}.${key}`;
|
|
113
|
+
unsanitizedFieldPath.push(unsanitizedKey);
|
|
114
|
+
let arrays = 0;
|
|
115
|
+
let value = exampleValue;
|
|
116
|
+
while (Array.isArray(value)) {
|
|
117
|
+
value = value[0];
|
|
118
|
+
arrays++;
|
|
119
|
+
}
|
|
120
|
+
let fieldConfig;
|
|
121
|
+
if (hasMapping(typeMapping, selector)) {
|
|
122
|
+
// TODO: Use `prefix` instead of `selector` in hasMapping and getFromMapping?
|
|
123
|
+
// i.e. does the config contain sanitized field names?
|
|
124
|
+
fieldConfig = getFieldConfigFromMapping({
|
|
125
|
+
typeMapping,
|
|
126
|
+
selector
|
|
127
|
+
});
|
|
128
|
+
} else if (unsanitizedKey.includes(`___NODE`)) {
|
|
129
|
+
// TODO(v5): Remove ability to use foreign keys like this (e.g. author___NODE___contact___email)
|
|
130
|
+
// and recommend using schema customization instead
|
|
131
|
+
|
|
132
|
+
fieldConfig = getFieldConfigFromFieldNameConvention({
|
|
133
|
+
schemaComposer,
|
|
134
|
+
value: exampleValue,
|
|
135
|
+
key: unsanitizedKey
|
|
136
|
+
});
|
|
137
|
+
arrays = arrays + (value.multiple ? 1 : 0);
|
|
138
|
+
deprecatedNodeKeys.add(unsanitizedKey);
|
|
139
|
+
} else {
|
|
140
|
+
fieldConfig = getSimpleFieldConfig({
|
|
141
|
+
schemaComposer,
|
|
142
|
+
typeComposer,
|
|
143
|
+
key,
|
|
144
|
+
value,
|
|
145
|
+
selector,
|
|
146
|
+
unsanitizedFieldPath,
|
|
147
|
+
typeMapping,
|
|
148
|
+
config,
|
|
149
|
+
arrays
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
unsanitizedFieldPath.pop();
|
|
153
|
+
if (!fieldConfig) return null;
|
|
154
|
+
|
|
155
|
+
// Proxy resolver to unsanitized fieldName in case it contained invalid characters
|
|
156
|
+
if (key !== unsanitizedKey.split(`___NODE`)[0]) {
|
|
157
|
+
fieldConfig = {
|
|
158
|
+
...fieldConfig,
|
|
159
|
+
extensions: {
|
|
160
|
+
...(fieldConfig.extensions || {}),
|
|
161
|
+
proxy: {
|
|
162
|
+
from: unsanitizedKey
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
while (arrays > 0) {
|
|
168
|
+
fieldConfig = {
|
|
169
|
+
...fieldConfig,
|
|
170
|
+
type: [fieldConfig.type]
|
|
171
|
+
};
|
|
172
|
+
arrays--;
|
|
173
|
+
}
|
|
174
|
+
return fieldConfig;
|
|
175
|
+
};
|
|
176
|
+
const resolveMultipleFields = possibleFields => {
|
|
177
|
+
const nodeField = possibleFields.find(field => field.unsanitizedKey.includes(`___NODE`));
|
|
178
|
+
if (nodeField) {
|
|
179
|
+
return nodeField;
|
|
180
|
+
}
|
|
181
|
+
const canonicalField = possibleFields.find(field => field.unsanitizedKey === field.key);
|
|
182
|
+
if (canonicalField) {
|
|
183
|
+
return canonicalField;
|
|
184
|
+
}
|
|
185
|
+
return _.sortBy(possibleFields, field => field.unsanitizedKey)[0];
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// XXX(freiksenet): removing this as it's a breaking change
|
|
189
|
+
// Deeper nested levels should be inferred as JSON.
|
|
190
|
+
// const MAX_DEPTH = 5
|
|
191
|
+
|
|
192
|
+
const hasMapping = (mapping, selector) => mapping && Object.keys(mapping).includes(selector);
|
|
193
|
+
const getFieldConfigFromMapping = ({
|
|
194
|
+
typeMapping,
|
|
195
|
+
selector
|
|
196
|
+
}) => {
|
|
197
|
+
const [type, ...path] = typeMapping[selector].split(`.`);
|
|
198
|
+
return {
|
|
199
|
+
type,
|
|
200
|
+
extensions: {
|
|
201
|
+
link: {
|
|
202
|
+
by: path.join(`.`) || `id`
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// probably should be in example value
|
|
209
|
+
const getFieldConfigFromFieldNameConvention = ({
|
|
210
|
+
schemaComposer,
|
|
211
|
+
value,
|
|
212
|
+
key
|
|
213
|
+
}) => {
|
|
214
|
+
const path = key.split(`___NODE___`)[1];
|
|
215
|
+
// Allow linking by nested fields, e.g. `author___NODE___contact___email`
|
|
216
|
+
const foreignKey = path && path.replace(/___/g, `.`);
|
|
217
|
+
const linkedTypesSet = new Set();
|
|
218
|
+
if (foreignKey) {
|
|
219
|
+
const linkedValues = new Set(value.linkedNodes);
|
|
220
|
+
getDataStore().iterateNodes().forEach(node => {
|
|
221
|
+
const value = _.get(node, foreignKey);
|
|
222
|
+
if (linkedValues.has(value)) {
|
|
223
|
+
linkedTypesSet.add(node.internal.type);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
} else {
|
|
227
|
+
value.linkedNodes.forEach(id => {
|
|
228
|
+
const node = getDataStore().getNode(id);
|
|
229
|
+
if (node) {
|
|
230
|
+
linkedTypesSet.add(node.internal.type);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const linkedTypes = [...linkedTypesSet];
|
|
235
|
+
invariant(linkedTypes.length, `Encountered an error trying to infer a GraphQL type for: \`${key}\`. ` + `There is no corresponding node with the \`id\` field matching: "${value.linkedNodes}".`);
|
|
236
|
+
let type;
|
|
237
|
+
// If the field value is an array that links to more than one type,
|
|
238
|
+
// create a GraphQLUnionType. Note that we don't support the case where
|
|
239
|
+
// scalar fields link to different types. Similarly, an array of objects
|
|
240
|
+
// with foreign-key fields will produce union types if those foreign-key
|
|
241
|
+
// fields are arrays, but not if they are scalars. See the tests for an example.
|
|
242
|
+
if (linkedTypes.length > 1) {
|
|
243
|
+
const typeName = linkedTypes.sort().join(``) + `Union`;
|
|
244
|
+
type = schemaComposer.getOrCreateUTC(typeName, utc => {
|
|
245
|
+
utc.setTypes(linkedTypes.map(typeName => schemaComposer.getOTC(typeName)));
|
|
246
|
+
utc.setResolveType(node => node.internal.type);
|
|
247
|
+
});
|
|
248
|
+
} else {
|
|
249
|
+
type = linkedTypes[0];
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
type,
|
|
253
|
+
extensions: {
|
|
254
|
+
link: {
|
|
255
|
+
by: foreignKey || `id`,
|
|
256
|
+
from: key
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
const getSimpleFieldConfig = ({
|
|
262
|
+
schemaComposer,
|
|
263
|
+
typeComposer,
|
|
264
|
+
key,
|
|
265
|
+
value,
|
|
266
|
+
selector,
|
|
267
|
+
unsanitizedFieldPath,
|
|
268
|
+
typeMapping,
|
|
269
|
+
config,
|
|
270
|
+
arrays
|
|
271
|
+
}) => {
|
|
272
|
+
switch (typeof value) {
|
|
273
|
+
case `boolean`:
|
|
274
|
+
return {
|
|
275
|
+
type: `Boolean`
|
|
276
|
+
};
|
|
277
|
+
case `number`:
|
|
278
|
+
return {
|
|
279
|
+
type: (0, _is32BitInteger.is32BitInteger)(value) ? `Int` : `Float`
|
|
280
|
+
};
|
|
281
|
+
case `string`:
|
|
282
|
+
if ((0, _date.isDate)(value)) {
|
|
283
|
+
return {
|
|
284
|
+
type: `Date`,
|
|
285
|
+
extensions: {
|
|
286
|
+
dateformat: {}
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
if ((0, _isFile.isFile)(unsanitizedFieldPath, value)) {
|
|
291
|
+
// NOTE: For arrays of files, where not every path references
|
|
292
|
+
// a File node in the db, it is semi-random if the field is
|
|
293
|
+
// inferred as File or String, since the exampleValue only has
|
|
294
|
+
// the first entry (which could point to an existing file or not).
|
|
295
|
+
return {
|
|
296
|
+
type: `File`,
|
|
297
|
+
extensions: {
|
|
298
|
+
fileByRelativePath: {}
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
type: `String`
|
|
304
|
+
};
|
|
305
|
+
case `object`:
|
|
306
|
+
if (value instanceof Date) {
|
|
307
|
+
return {
|
|
308
|
+
type: `Date`,
|
|
309
|
+
extensions: {
|
|
310
|
+
dateformat: {}
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
if (value instanceof String) {
|
|
315
|
+
return {
|
|
316
|
+
type: `String`
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
if (value /* && depth < MAX_DEPTH*/) {
|
|
320
|
+
let fieldTypeComposer;
|
|
321
|
+
if (typeComposer.hasField(key)) {
|
|
322
|
+
fieldTypeComposer = typeComposer.getFieldTC(key);
|
|
323
|
+
// If we have an object as a field value, but the field type is
|
|
324
|
+
// explicitly defined as something other than an ObjectType
|
|
325
|
+
// we can bail early.
|
|
326
|
+
if (!(fieldTypeComposer instanceof ObjectTypeComposer)) return null;
|
|
327
|
+
// If the array depth of the field value and of the explicitly
|
|
328
|
+
// defined field type don't match we can also bail early.
|
|
329
|
+
let lists = 0;
|
|
330
|
+
let fieldType = typeComposer.getFieldType(key);
|
|
331
|
+
while (fieldType.ofType) {
|
|
332
|
+
if (fieldType instanceof GraphQLList) lists++;
|
|
333
|
+
fieldType = fieldType.ofType;
|
|
334
|
+
}
|
|
335
|
+
if (lists !== arrays) return null;
|
|
336
|
+
} else {
|
|
337
|
+
// When the field type has not been explicitly defined, we
|
|
338
|
+
// don't need to continue in case of @dontInfer
|
|
339
|
+
if (!config.shouldAddFields) return null;
|
|
340
|
+
const typeName = createTypeName(selector);
|
|
341
|
+
if (schemaComposer.has(typeName)) {
|
|
342
|
+
// Type could have been already created via schema customization
|
|
343
|
+
fieldTypeComposer = schemaComposer.getOTC(typeName);
|
|
344
|
+
} else {
|
|
345
|
+
fieldTypeComposer = ObjectTypeComposer.create(typeName, schemaComposer);
|
|
346
|
+
fieldTypeComposer.setExtension(`createdFrom`, `inference`);
|
|
347
|
+
fieldTypeComposer.setExtension(`plugin`, typeComposer.getExtension(`plugin`));
|
|
348
|
+
(0, _derivedTypes.addDerivedType)({
|
|
349
|
+
typeComposer,
|
|
350
|
+
derivedTypeName: fieldTypeComposer.getTypeName()
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Inference config options are either explicitly defined on a type
|
|
356
|
+
// with directive/extension, or inherited from the parent type.
|
|
357
|
+
const inferenceConfig = getInferenceConfig({
|
|
358
|
+
typeComposer: fieldTypeComposer,
|
|
359
|
+
defaults: config
|
|
360
|
+
});
|
|
361
|
+
return {
|
|
362
|
+
type: addInferredFieldsImpl({
|
|
363
|
+
schemaComposer,
|
|
364
|
+
typeComposer: fieldTypeComposer,
|
|
365
|
+
exampleObject: value,
|
|
366
|
+
typeMapping,
|
|
367
|
+
prefix: selector,
|
|
368
|
+
unsanitizedFieldPath,
|
|
369
|
+
config: inferenceConfig
|
|
370
|
+
})
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
throw new Error(`Can't determine type for "${value}" in \`${selector}\`.`);
|
|
375
|
+
};
|
|
376
|
+
const createTypeName = selector => {
|
|
377
|
+
const keys = selector.split(`.`);
|
|
378
|
+
const suffix = keys.slice(1).map(_.upperFirst).join(``);
|
|
379
|
+
return `${keys[0]}${suffix}`;
|
|
380
|
+
};
|
|
381
|
+
const NON_ALPHA_NUMERIC_EXPR = new RegExp(`[^a-zA-Z0-9_]`, `g`);
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* GraphQL field names must be a string and cannot contain anything other than
|
|
385
|
+
* alphanumeric characters and `_`. They also can't start with `__` which is
|
|
386
|
+
* reserved for internal fields (`___foo` doesn't work either).
|
|
387
|
+
*/
|
|
388
|
+
const createFieldName = key => {
|
|
389
|
+
// Check if the key is really a string otherwise GraphQL will throw.
|
|
390
|
+
invariant(typeof key === `string`, `GraphQL field name (key) is not a string: \`${key}\`.`);
|
|
391
|
+
const fieldName = key.split(`___NODE`)[0];
|
|
392
|
+
const replaced = fieldName.replace(NON_ALPHA_NUMERIC_EXPR, `_`);
|
|
393
|
+
|
|
394
|
+
// key is invalid; normalize with leading underscore and rest with x
|
|
395
|
+
if (replaced.match(/^__/)) {
|
|
396
|
+
return replaced.replace(/_/g, (char, index) => index === 0 ? `_` : `x`);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// key is invalid (starts with numeric); normalize with leading underscore
|
|
400
|
+
if (replaced.match(/^[0-9]/)) {
|
|
401
|
+
return `_` + replaced;
|
|
402
|
+
}
|
|
403
|
+
return replaced;
|
|
404
|
+
};
|
|
405
|
+
const getInferenceConfig = ({
|
|
406
|
+
typeComposer,
|
|
407
|
+
defaults
|
|
408
|
+
}) => {
|
|
409
|
+
return {
|
|
410
|
+
shouldAddFields: typeComposer.hasExtension(`infer`) ? typeComposer.getExtension(`infer`) : defaults.shouldAddFields
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
//# sourceMappingURL=add-inferred-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-inferred-fields.js","names":["_","require","ObjectTypeComposer","GraphQLList","invariant","report","getDataStore","addInferredFields","schemaComposer","typeComposer","exampleValue","typeMapping","config","getInferenceConfig","defaults","shouldAddFields","addInferredFieldsImpl","exampleObject","prefix","getTypeName","unsanitizedFieldPath","deprecatedNodeKeys","size","plugin","getExtension","reportOnce","module","exports","fields","Object","keys","forEach","unsanitizedKey","key","createFieldName","push","fieldsByKey","groupBy","field","possibleFields","selectedField","length","resolveMultipleFields","possibleFieldsNames","map","join","warn","fieldConfig","getFieldConfig","hasField","addFields","setFieldExtension","Set","selector","arrays","value","Array","isArray","hasMapping","getFieldConfigFromMapping","includes","getFieldConfigFromFieldNameConvention","multiple","add","getSimpleFieldConfig","pop","split","extensions","proxy","from","type","nodeField","find","canonicalField","sortBy","mapping","path","link","by","foreignKey","replace","linkedTypesSet","linkedValues","linkedNodes","iterateNodes","node","get","has","internal","id","getNode","linkedTypes","typeName","sort","getOrCreateUTC","utc","setTypes","getOTC","setResolveType","is32BitInteger","isDate","dateformat","isFile","fileByRelativePath","Date","String","fieldTypeComposer","getFieldTC","lists","fieldType","getFieldType","ofType","createTypeName","create","setExtension","addDerivedType","derivedTypeName","inferenceConfig","Error","suffix","slice","upperFirst","NON_ALPHA_NUMERIC_EXPR","RegExp","fieldName","replaced","match","char","index","hasExtension"],"sources":["../../../src/schema/infer/add-inferred-fields.js"],"sourcesContent":["const _ = require(`lodash`)\nconst { ObjectTypeComposer } = require(`graphql-compose`)\nconst { GraphQLList } = require(`graphql`)\nconst invariant = require(`invariant`)\nconst report = require(`gatsby-cli/lib/reporter`)\n\nimport { isFile } from \"./is-file\"\nimport { isDate } from \"../types/date\"\nimport { addDerivedType } from \"../types/derived-types\"\nimport { reportOnce } from \"../../utils/report-once\"\nimport { is32BitInteger } from \"../../utils/is-32-bit-integer\"\nconst { getDataStore } = require(`../../datastore`)\n\nconst addInferredFields = ({\n schemaComposer,\n typeComposer,\n exampleValue,\n typeMapping,\n}) => {\n const config = getInferenceConfig({\n typeComposer,\n defaults: {\n shouldAddFields: true,\n },\n })\n addInferredFieldsImpl({\n schemaComposer,\n typeComposer,\n exampleObject: exampleValue,\n prefix: typeComposer.getTypeName(),\n unsanitizedFieldPath: [typeComposer.getTypeName()],\n typeMapping,\n config,\n })\n\n if (deprecatedNodeKeys.size > 0) {\n const plugin = typeComposer.getExtension(`plugin`)\n\n reportOnce(\n `Plugin \"${plugin}\" is using the ___NODE convention which is deprecated. This plugin should use the @link directive instead.\\nMigration: https://gatsby.dev/node-convention-deprecation`,\n `verbose`\n )\n }\n}\n\nmodule.exports = {\n addInferredFields,\n}\n\nconst addInferredFieldsImpl = ({\n schemaComposer,\n typeComposer,\n exampleObject,\n typeMapping,\n prefix,\n unsanitizedFieldPath,\n config,\n}) => {\n const fields = []\n Object.keys(exampleObject).forEach(unsanitizedKey => {\n const key = createFieldName(unsanitizedKey)\n fields.push({\n key,\n unsanitizedKey,\n exampleValue: exampleObject[unsanitizedKey],\n })\n })\n\n const fieldsByKey = _.groupBy(fields, field => field.key)\n\n Object.keys(fieldsByKey).forEach(key => {\n const possibleFields = fieldsByKey[key]\n let selectedField\n if (possibleFields.length > 1) {\n const field = resolveMultipleFields(possibleFields)\n const possibleFieldsNames = possibleFields\n .map(field => `\\`${field.unsanitizedKey}\\``)\n .join(`, `)\n report.warn(\n `Multiple node fields resolve to the same GraphQL field \\`${prefix}.${field.key}\\` - [${possibleFieldsNames}]. Gatsby will use \\`${field.unsanitizedKey}\\`.`\n )\n selectedField = field\n } else {\n selectedField = possibleFields[0]\n }\n\n const fieldConfig = getFieldConfig({\n ...selectedField,\n schemaComposer,\n typeComposer,\n prefix,\n unsanitizedFieldPath,\n typeMapping,\n config,\n })\n\n if (!fieldConfig) return\n\n if (!typeComposer.hasField(key)) {\n if (config.shouldAddFields) {\n typeComposer.addFields({ [key]: fieldConfig })\n typeComposer.setFieldExtension(key, `createdFrom`, `inference`)\n }\n }\n })\n\n return typeComposer\n}\n\nconst deprecatedNodeKeys = new Set()\n\nconst getFieldConfig = ({\n schemaComposer,\n typeComposer,\n prefix,\n exampleValue,\n key,\n unsanitizedKey,\n unsanitizedFieldPath,\n typeMapping,\n config,\n}) => {\n const selector = `${prefix}.${key}`\n unsanitizedFieldPath.push(unsanitizedKey)\n\n let arrays = 0\n let value = exampleValue\n while (Array.isArray(value)) {\n value = value[0]\n arrays++\n }\n\n let fieldConfig\n if (hasMapping(typeMapping, selector)) {\n // TODO: Use `prefix` instead of `selector` in hasMapping and getFromMapping?\n // i.e. does the config contain sanitized field names?\n fieldConfig = getFieldConfigFromMapping({ typeMapping, selector })\n } else if (unsanitizedKey.includes(`___NODE`)) {\n // TODO(v5): Remove ability to use foreign keys like this (e.g. author___NODE___contact___email)\n // and recommend using schema customization instead\n\n fieldConfig = getFieldConfigFromFieldNameConvention({\n schemaComposer,\n value: exampleValue,\n key: unsanitizedKey,\n })\n arrays = arrays + (value.multiple ? 1 : 0)\n\n deprecatedNodeKeys.add(unsanitizedKey)\n } else {\n fieldConfig = getSimpleFieldConfig({\n schemaComposer,\n typeComposer,\n key,\n value,\n selector,\n unsanitizedFieldPath,\n typeMapping,\n config,\n arrays,\n })\n }\n\n unsanitizedFieldPath.pop()\n if (!fieldConfig) return null\n\n // Proxy resolver to unsanitized fieldName in case it contained invalid characters\n if (key !== unsanitizedKey.split(`___NODE`)[0]) {\n fieldConfig = {\n ...fieldConfig,\n extensions: {\n ...(fieldConfig.extensions || {}),\n proxy: { from: unsanitizedKey },\n },\n }\n }\n\n while (arrays > 0) {\n fieldConfig = { ...fieldConfig, type: [fieldConfig.type] }\n arrays--\n }\n\n return fieldConfig\n}\n\nconst resolveMultipleFields = possibleFields => {\n const nodeField = possibleFields.find(field =>\n field.unsanitizedKey.includes(`___NODE`)\n )\n if (nodeField) {\n return nodeField\n }\n\n const canonicalField = possibleFields.find(\n field => field.unsanitizedKey === field.key\n )\n if (canonicalField) {\n return canonicalField\n }\n\n return _.sortBy(possibleFields, field => field.unsanitizedKey)[0]\n}\n\n// XXX(freiksenet): removing this as it's a breaking change\n// Deeper nested levels should be inferred as JSON.\n// const MAX_DEPTH = 5\n\nconst hasMapping = (mapping, selector) =>\n mapping && Object.keys(mapping).includes(selector)\n\nconst getFieldConfigFromMapping = ({ typeMapping, selector }) => {\n const [type, ...path] = typeMapping[selector].split(`.`)\n return {\n type,\n extensions: {\n link: { by: path.join(`.`) || `id` },\n },\n }\n}\n\n// probably should be in example value\nconst getFieldConfigFromFieldNameConvention = ({\n schemaComposer,\n value,\n key,\n}) => {\n const path = key.split(`___NODE___`)[1]\n // Allow linking by nested fields, e.g. `author___NODE___contact___email`\n const foreignKey = path && path.replace(/___/g, `.`)\n const linkedTypesSet = new Set()\n\n if (foreignKey) {\n const linkedValues = new Set(value.linkedNodes)\n getDataStore()\n .iterateNodes()\n .forEach(node => {\n const value = _.get(node, foreignKey)\n if (linkedValues.has(value)) {\n linkedTypesSet.add(node.internal.type)\n }\n })\n } else {\n value.linkedNodes.forEach(id => {\n const node = getDataStore().getNode(id)\n if (node) {\n linkedTypesSet.add(node.internal.type)\n }\n })\n }\n\n const linkedTypes = [...linkedTypesSet]\n\n invariant(\n linkedTypes.length,\n `Encountered an error trying to infer a GraphQL type for: \\`${key}\\`. ` +\n `There is no corresponding node with the \\`id\\` field matching: \"${value.linkedNodes}\".`\n )\n\n let type\n // If the field value is an array that links to more than one type,\n // create a GraphQLUnionType. Note that we don't support the case where\n // scalar fields link to different types. Similarly, an array of objects\n // with foreign-key fields will produce union types if those foreign-key\n // fields are arrays, but not if they are scalars. See the tests for an example.\n if (linkedTypes.length > 1) {\n const typeName = linkedTypes.sort().join(``) + `Union`\n type = schemaComposer.getOrCreateUTC(typeName, utc => {\n utc.setTypes(linkedTypes.map(typeName => schemaComposer.getOTC(typeName)))\n utc.setResolveType(node => node.internal.type)\n })\n } else {\n type = linkedTypes[0]\n }\n\n return {\n type,\n extensions: {\n link: { by: foreignKey || `id`, from: key },\n },\n }\n}\n\nconst getSimpleFieldConfig = ({\n schemaComposer,\n typeComposer,\n key,\n value,\n selector,\n unsanitizedFieldPath,\n typeMapping,\n config,\n arrays,\n}) => {\n switch (typeof value) {\n case `boolean`:\n return { type: `Boolean` }\n case `number`:\n return { type: is32BitInteger(value) ? `Int` : `Float` }\n case `string`:\n if (isDate(value)) {\n return { type: `Date`, extensions: { dateformat: {} } }\n }\n if (isFile(unsanitizedFieldPath, value)) {\n // NOTE: For arrays of files, where not every path references\n // a File node in the db, it is semi-random if the field is\n // inferred as File or String, since the exampleValue only has\n // the first entry (which could point to an existing file or not).\n return { type: `File`, extensions: { fileByRelativePath: {} } }\n }\n return { type: `String` }\n case `object`:\n if (value instanceof Date) {\n return { type: `Date`, extensions: { dateformat: {} } }\n }\n if (value instanceof String) {\n return { type: `String` }\n }\n if (value /* && depth < MAX_DEPTH*/) {\n let fieldTypeComposer\n if (typeComposer.hasField(key)) {\n fieldTypeComposer = typeComposer.getFieldTC(key)\n // If we have an object as a field value, but the field type is\n // explicitly defined as something other than an ObjectType\n // we can bail early.\n if (!(fieldTypeComposer instanceof ObjectTypeComposer)) return null\n // If the array depth of the field value and of the explicitly\n // defined field type don't match we can also bail early.\n let lists = 0\n let fieldType = typeComposer.getFieldType(key)\n while (fieldType.ofType) {\n if (fieldType instanceof GraphQLList) lists++\n fieldType = fieldType.ofType\n }\n if (lists !== arrays) return null\n } else {\n // When the field type has not been explicitly defined, we\n // don't need to continue in case of @dontInfer\n if (!config.shouldAddFields) return null\n\n const typeName = createTypeName(selector)\n if (schemaComposer.has(typeName)) {\n // Type could have been already created via schema customization\n fieldTypeComposer = schemaComposer.getOTC(typeName)\n } else {\n fieldTypeComposer = ObjectTypeComposer.create(\n typeName,\n schemaComposer\n )\n fieldTypeComposer.setExtension(`createdFrom`, `inference`)\n fieldTypeComposer.setExtension(\n `plugin`,\n typeComposer.getExtension(`plugin`)\n )\n addDerivedType({\n typeComposer,\n derivedTypeName: fieldTypeComposer.getTypeName(),\n })\n }\n }\n\n // Inference config options are either explicitly defined on a type\n // with directive/extension, or inherited from the parent type.\n const inferenceConfig = getInferenceConfig({\n typeComposer: fieldTypeComposer,\n defaults: config,\n })\n\n return {\n type: addInferredFieldsImpl({\n schemaComposer,\n typeComposer: fieldTypeComposer,\n exampleObject: value,\n typeMapping,\n prefix: selector,\n unsanitizedFieldPath,\n config: inferenceConfig,\n }),\n }\n }\n }\n throw new Error(`Can't determine type for \"${value}\" in \\`${selector}\\`.`)\n}\n\nconst createTypeName = selector => {\n const keys = selector.split(`.`)\n const suffix = keys.slice(1).map(_.upperFirst).join(``)\n return `${keys[0]}${suffix}`\n}\n\nconst NON_ALPHA_NUMERIC_EXPR = new RegExp(`[^a-zA-Z0-9_]`, `g`)\n\n/**\n * GraphQL field names must be a string and cannot contain anything other than\n * alphanumeric characters and `_`. They also can't start with `__` which is\n * reserved for internal fields (`___foo` doesn't work either).\n */\nconst createFieldName = key => {\n // Check if the key is really a string otherwise GraphQL will throw.\n invariant(\n typeof key === `string`,\n `GraphQL field name (key) is not a string: \\`${key}\\`.`\n )\n\n const fieldName = key.split(`___NODE`)[0]\n const replaced = fieldName.replace(NON_ALPHA_NUMERIC_EXPR, `_`)\n\n // key is invalid; normalize with leading underscore and rest with x\n if (replaced.match(/^__/)) {\n return replaced.replace(/_/g, (char, index) => (index === 0 ? `_` : `x`))\n }\n\n // key is invalid (starts with numeric); normalize with leading underscore\n if (replaced.match(/^[0-9]/)) {\n return `_` + replaced\n }\n\n return replaced\n}\n\nconst getInferenceConfig = ({ typeComposer, defaults }) => {\n return {\n shouldAddFields: typeComposer.hasExtension(`infer`)\n ? typeComposer.getExtension(`infer`)\n : defaults.shouldAddFields,\n }\n}\n"],"mappings":";;AAMA;AACA;AACA;AACA;AACA;AAVA,MAAMA,CAAC,GAAGC,OAAO,CAAE,QAAO,CAAC;AAC3B,MAAM;EAAEC;AAAmB,CAAC,GAAGD,OAAO,CAAE,iBAAgB,CAAC;AACzD,MAAM;EAAEE;AAAY,CAAC,GAAGF,OAAO,CAAE,SAAQ,CAAC;AAC1C,MAAMG,SAAS,GAAGH,OAAO,CAAE,WAAU,CAAC;AACtC,MAAMI,MAAM,GAAGJ,OAAO,CAAE,yBAAwB,CAAC;AAOjD,MAAM;EAAEK;AAAa,CAAC,GAAGL,OAAO,CAAE,iBAAgB,CAAC;AAEnD,MAAMM,iBAAiB,GAAG,CAAC;EACzBC,cAAc;EACdC,YAAY;EACZC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAMC,MAAM,GAAGC,kBAAkB,CAAC;IAChCJ,YAAY;IACZK,QAAQ,EAAE;MACRC,eAAe,EAAE;IACnB;EACF,CAAC,CAAC;EACFC,qBAAqB,CAAC;IACpBR,cAAc;IACdC,YAAY;IACZQ,aAAa,EAAEP,YAAY;IAC3BQ,MAAM,EAAET,YAAY,CAACU,WAAW,EAAE;IAClCC,oBAAoB,EAAE,CAACX,YAAY,CAACU,WAAW,EAAE,CAAC;IAClDR,WAAW;IACXC;EACF,CAAC,CAAC;EAEF,IAAIS,kBAAkB,CAACC,IAAI,GAAG,CAAC,EAAE;IAC/B,MAAMC,MAAM,GAAGd,YAAY,CAACe,YAAY,CAAE,QAAO,CAAC;IAElD,IAAAC,sBAAU,EACP,WAAUF,MAAO,uKAAsK,EACvL,SAAQ,CACV;EACH;AACF,CAAC;AAEDG,MAAM,CAACC,OAAO,GAAG;EACfpB;AACF,CAAC;AAED,MAAMS,qBAAqB,GAAG,CAAC;EAC7BR,cAAc;EACdC,YAAY;EACZQ,aAAa;EACbN,WAAW;EACXO,MAA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ACC,KAAK,CAAC,QAAQ,CAAC,EAAE;IAC5B,OAAQ,GAAE,GAAGD,QAAQ;EACvB;EAEA,OAAOA,QAAQ;AACjB,CAAC;AAED,MAAMhH,kBAAkB,GAAG,CAAC;EAAEJ,YAAY;EAAEK;AAAS,CAAC,KAAK;EACzD,OAAO;IACLC,eAAe,EAAEN,YAAY,CAACwH,YAAY,CAAE,OAAM,CAAC,GAC/CxH,YAAY,CAACe,YAAY,CAAE,OAAM,CAAC,GAClCV,QAAQ,CAACC;EACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.getExampleObject = void 0;
|
|
6
|
+
var _groupBy2 = _interopRequireDefault(require("lodash/groupBy"));
|
|
7
|
+
// See gatsby/src/schema/infer/inference-metadata.ts for the ValueDescriptor structs (-> typeInfo)
|
|
8
|
+
|
|
9
|
+
const getExampleObject = ({
|
|
10
|
+
fieldMap = {},
|
|
11
|
+
typeName,
|
|
12
|
+
typeConflictReporter
|
|
13
|
+
}) => Object.keys(fieldMap).reduce((acc, key) => {
|
|
14
|
+
const value = buildExampleValue({
|
|
15
|
+
path: `${typeName}.${key}`,
|
|
16
|
+
descriptor: fieldMap[key],
|
|
17
|
+
typeConflictReporter
|
|
18
|
+
});
|
|
19
|
+
if (key && value !== null) {
|
|
20
|
+
acc[key] = value;
|
|
21
|
+
}
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
exports.getExampleObject = getExampleObject;
|
|
25
|
+
const buildExampleValue = ({
|
|
26
|
+
descriptor,
|
|
27
|
+
typeConflictReporter,
|
|
28
|
+
isArrayItem = false,
|
|
29
|
+
path = ``
|
|
30
|
+
}) => {
|
|
31
|
+
const [type, conflicts = false] = resolveWinnerType(descriptor);
|
|
32
|
+
if (conflicts && typeConflictReporter) {
|
|
33
|
+
typeConflictReporter.addConflict(path, prepareConflictExamples(descriptor, isArrayItem));
|
|
34
|
+
}
|
|
35
|
+
const typeInfo = descriptor[type];
|
|
36
|
+
switch (type) {
|
|
37
|
+
case `null`:
|
|
38
|
+
return null;
|
|
39
|
+
case `date`:
|
|
40
|
+
case `string`:
|
|
41
|
+
{
|
|
42
|
+
if (isMixOfDateAndString(descriptor)) {
|
|
43
|
+
return hasOnlyEmptyStrings(descriptor) ? `1978-09-26` : `String`;
|
|
44
|
+
}
|
|
45
|
+
return typeInfo.example;
|
|
46
|
+
}
|
|
47
|
+
case `array`:
|
|
48
|
+
{
|
|
49
|
+
const {
|
|
50
|
+
item
|
|
51
|
+
} = typeInfo;
|
|
52
|
+
const exampleItemValue = item ? buildExampleValue({
|
|
53
|
+
descriptor: item,
|
|
54
|
+
isArrayItem: true,
|
|
55
|
+
typeConflictReporter,
|
|
56
|
+
path
|
|
57
|
+
}) : null;
|
|
58
|
+
return exampleItemValue === null ? null : [exampleItemValue];
|
|
59
|
+
}
|
|
60
|
+
case `relatedNode`:
|
|
61
|
+
case `relatedNodeList`:
|
|
62
|
+
{
|
|
63
|
+
const {
|
|
64
|
+
nodes = {}
|
|
65
|
+
} = typeInfo;
|
|
66
|
+
return {
|
|
67
|
+
multiple: type === `relatedNodeList`,
|
|
68
|
+
linkedNodes: Object.keys(nodes).filter(key => nodes[key] > 0)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
case `object`:
|
|
72
|
+
{
|
|
73
|
+
const {
|
|
74
|
+
dprops
|
|
75
|
+
} = typeInfo;
|
|
76
|
+
let hasKeys = false;
|
|
77
|
+
const result = {};
|
|
78
|
+
Object.keys(dprops).forEach(prop => {
|
|
79
|
+
const value = buildExampleValue({
|
|
80
|
+
descriptor: dprops[prop],
|
|
81
|
+
typeConflictReporter,
|
|
82
|
+
path: `${path}.${prop}`
|
|
83
|
+
});
|
|
84
|
+
if (value !== null) {
|
|
85
|
+
hasKeys = true;
|
|
86
|
+
result[prop] = value;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return hasKeys ? result : null;
|
|
90
|
+
}
|
|
91
|
+
default:
|
|
92
|
+
return typeInfo.example;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const resolveWinnerType = descriptor => {
|
|
96
|
+
const candidates = possibleTypes(descriptor);
|
|
97
|
+
if (candidates.length === 1) {
|
|
98
|
+
return [candidates[0]];
|
|
99
|
+
}
|
|
100
|
+
if (candidates.length === 2 && isMixedNumber(descriptor)) {
|
|
101
|
+
return [`float`];
|
|
102
|
+
}
|
|
103
|
+
if (candidates.length === 2 && isMixOfDateAndString(descriptor)) {
|
|
104
|
+
return [hasOnlyEmptyStrings(descriptor) ? `date` : `string`];
|
|
105
|
+
}
|
|
106
|
+
if (candidates.length > 1) {
|
|
107
|
+
return [`null`, true];
|
|
108
|
+
}
|
|
109
|
+
return [`null`];
|
|
110
|
+
};
|
|
111
|
+
const prepareConflictExamples = (descriptor, isArrayItem) => {
|
|
112
|
+
const typeNameMapper = typeName => {
|
|
113
|
+
if (typeName === `relatedNode`) {
|
|
114
|
+
return `string`;
|
|
115
|
+
}
|
|
116
|
+
if (typeName === `relatedNodeList`) {
|
|
117
|
+
return `[string]`;
|
|
118
|
+
}
|
|
119
|
+
return [`float`, `int`].includes(typeName) ? `number` : typeName;
|
|
120
|
+
};
|
|
121
|
+
const reportedValueMapper = typeName => {
|
|
122
|
+
var _descriptor$typeName;
|
|
123
|
+
if (typeName === `relatedNode`) {
|
|
124
|
+
var _descriptor$relatedNo;
|
|
125
|
+
const {
|
|
126
|
+
nodes
|
|
127
|
+
} = (_descriptor$relatedNo = descriptor.relatedNode) !== null && _descriptor$relatedNo !== void 0 ? _descriptor$relatedNo : {
|
|
128
|
+
nodes: {}
|
|
129
|
+
};
|
|
130
|
+
return Object.keys(nodes).find(key => nodes[key] > 0);
|
|
131
|
+
}
|
|
132
|
+
if (typeName === `relatedNodeList`) {
|
|
133
|
+
var _descriptor$relatedNo2;
|
|
134
|
+
const {
|
|
135
|
+
nodes
|
|
136
|
+
} = (_descriptor$relatedNo2 = descriptor.relatedNodeList) !== null && _descriptor$relatedNo2 !== void 0 ? _descriptor$relatedNo2 : {
|
|
137
|
+
nodes: {}
|
|
138
|
+
};
|
|
139
|
+
return Object.keys(nodes).filter(key => nodes[key] > 0);
|
|
140
|
+
}
|
|
141
|
+
if (typeName === `object`) {
|
|
142
|
+
return getExampleObject({
|
|
143
|
+
typeName,
|
|
144
|
+
fieldMap: descriptor.object.dprops
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (typeName === `array`) {
|
|
148
|
+
const itemValue = buildExampleValue({
|
|
149
|
+
descriptor: descriptor.array.item,
|
|
150
|
+
isArrayItem: true
|
|
151
|
+
});
|
|
152
|
+
return itemValue === null || itemValue === undefined ? [] : [itemValue];
|
|
153
|
+
}
|
|
154
|
+
return (_descriptor$typeName = descriptor[typeName]) === null || _descriptor$typeName === void 0 ? void 0 : _descriptor$typeName.example;
|
|
155
|
+
};
|
|
156
|
+
const conflictingTypes = possibleTypes(descriptor);
|
|
157
|
+
if (isArrayItem) {
|
|
158
|
+
// Differentiate conflict examples by node they were first seen in.
|
|
159
|
+
// See Caveats section in the header of the ./inference-metadata.ts
|
|
160
|
+
const groups = (0, _groupBy2.default)(conflictingTypes, type => {
|
|
161
|
+
var _descriptor$type;
|
|
162
|
+
return ((_descriptor$type = descriptor[type]) === null || _descriptor$type === void 0 ? void 0 : _descriptor$type.first) || ``;
|
|
163
|
+
});
|
|
164
|
+
return Object.keys(groups).map(nodeId => {
|
|
165
|
+
return {
|
|
166
|
+
type: `[${groups[nodeId].map(typeNameMapper).join(`,`)}]`,
|
|
167
|
+
value: groups[nodeId].map(reportedValueMapper)
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return conflictingTypes.map(type => {
|
|
172
|
+
return {
|
|
173
|
+
type: typeNameMapper(type),
|
|
174
|
+
value: reportedValueMapper(type)
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
const isMixedNumber = descriptor => {
|
|
179
|
+
const {
|
|
180
|
+
float,
|
|
181
|
+
int
|
|
182
|
+
} = descriptor;
|
|
183
|
+
return Boolean(float === null || float === void 0 ? void 0 : float.total) && Boolean(int === null || int === void 0 ? void 0 : int.total);
|
|
184
|
+
};
|
|
185
|
+
const isMixOfDateAndString = descriptor => {
|
|
186
|
+
const {
|
|
187
|
+
date,
|
|
188
|
+
string
|
|
189
|
+
} = descriptor;
|
|
190
|
+
return Boolean(date === null || date === void 0 ? void 0 : date.total) && Boolean(string === null || string === void 0 ? void 0 : string.total);
|
|
191
|
+
};
|
|
192
|
+
const hasOnlyEmptyStrings = descriptor => {
|
|
193
|
+
const {
|
|
194
|
+
string
|
|
195
|
+
} = descriptor;
|
|
196
|
+
return string !== undefined && (string === null || string === void 0 ? void 0 : string.empty) === (string === null || string === void 0 ? void 0 : string.total);
|
|
197
|
+
};
|
|
198
|
+
const possibleTypes = (descriptor = {}) => Object.keys(descriptor).filter(type => descriptor[type].total > 0);
|
|
199
|
+
//# sourceMappingURL=build-example-data.js.map
|