@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,1295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _pagination = require("./types/pagination");
|
|
4
|
+
var _sort = require("./types/sort");
|
|
5
|
+
var _filter = require("./types/filter");
|
|
6
|
+
var _typeBuilders = require("./types/type-builders");
|
|
7
|
+
const _ = require(`lodash`);
|
|
8
|
+
const invariant = require(`invariant`);
|
|
9
|
+
const {
|
|
10
|
+
isSpecifiedScalarType,
|
|
11
|
+
isIntrospectionType,
|
|
12
|
+
assertValidName,
|
|
13
|
+
GraphQLNonNull,
|
|
14
|
+
GraphQLList,
|
|
15
|
+
GraphQLObjectType,
|
|
16
|
+
GraphQLInterfaceType,
|
|
17
|
+
GraphQLUnionType
|
|
18
|
+
} = require(`graphql`);
|
|
19
|
+
const {
|
|
20
|
+
ObjectTypeComposer,
|
|
21
|
+
InterfaceTypeComposer,
|
|
22
|
+
UnionTypeComposer,
|
|
23
|
+
InputTypeComposer,
|
|
24
|
+
ScalarTypeComposer,
|
|
25
|
+
EnumTypeComposer
|
|
26
|
+
} = require(`graphql-compose`);
|
|
27
|
+
const {
|
|
28
|
+
getDataStore,
|
|
29
|
+
getNode,
|
|
30
|
+
getNodesByType
|
|
31
|
+
} = require(`../datastore`);
|
|
32
|
+
const apiRunner = require(`../utils/api-runner-node`);
|
|
33
|
+
const report = require(`gatsby-cli/lib/reporter`);
|
|
34
|
+
const {
|
|
35
|
+
addNodeInterfaceFields
|
|
36
|
+
} = require(`./types/node-interface`);
|
|
37
|
+
const {
|
|
38
|
+
overridableBuiltInTypeNames,
|
|
39
|
+
builtInScalarTypeNames
|
|
40
|
+
} = require(`./types/built-in-types`);
|
|
41
|
+
const {
|
|
42
|
+
addInferredTypes
|
|
43
|
+
} = require(`./infer`);
|
|
44
|
+
const {
|
|
45
|
+
addRemoteFileInterfaceFields
|
|
46
|
+
} = require(`./types/remote-file-interface`);
|
|
47
|
+
const {
|
|
48
|
+
findOne,
|
|
49
|
+
findManyPaginated,
|
|
50
|
+
wrappingResolver,
|
|
51
|
+
defaultResolver
|
|
52
|
+
} = require(`./resolvers`);
|
|
53
|
+
const {
|
|
54
|
+
processFieldExtensions,
|
|
55
|
+
internalExtensionNames
|
|
56
|
+
} = require(`./extensions`);
|
|
57
|
+
const {
|
|
58
|
+
isASTDocument,
|
|
59
|
+
parseTypeDef,
|
|
60
|
+
reportParsingError
|
|
61
|
+
} = require(`./types/type-defs`);
|
|
62
|
+
const {
|
|
63
|
+
printTypeDefinitions
|
|
64
|
+
} = require(`./print`);
|
|
65
|
+
const buildSchema = async ({
|
|
66
|
+
schemaComposer,
|
|
67
|
+
types,
|
|
68
|
+
typeMapping,
|
|
69
|
+
fieldExtensions,
|
|
70
|
+
thirdPartySchemas,
|
|
71
|
+
printConfig,
|
|
72
|
+
enginePrintConfig,
|
|
73
|
+
typeConflictReporter,
|
|
74
|
+
inferenceMetadata,
|
|
75
|
+
parentSpan
|
|
76
|
+
}) => {
|
|
77
|
+
// FIXME: consider removing .ready here - it is needed for various tests to pass (although probably harmless)
|
|
78
|
+
await getDataStore().ready();
|
|
79
|
+
await updateSchemaComposer({
|
|
80
|
+
schemaComposer,
|
|
81
|
+
types,
|
|
82
|
+
typeMapping,
|
|
83
|
+
fieldExtensions,
|
|
84
|
+
thirdPartySchemas,
|
|
85
|
+
printConfig,
|
|
86
|
+
enginePrintConfig,
|
|
87
|
+
typeConflictReporter,
|
|
88
|
+
inferenceMetadata,
|
|
89
|
+
parentSpan
|
|
90
|
+
});
|
|
91
|
+
// const { printSchema } = require(`graphql`)
|
|
92
|
+
const schema = schemaComposer.buildSchema();
|
|
93
|
+
freezeTypeComposers(schemaComposer);
|
|
94
|
+
|
|
95
|
+
// console.log(printSchema(schema))
|
|
96
|
+
return schema;
|
|
97
|
+
};
|
|
98
|
+
module.exports = {
|
|
99
|
+
buildSchema
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Workaround for https://github.com/graphql-compose/graphql-compose/issues/319
|
|
103
|
+
// FIXME: remove this when fixed in graphql-compose
|
|
104
|
+
const freezeTypeComposers = (schemaComposer, excluded = new Set()) => {
|
|
105
|
+
Array.from(schemaComposer.values()).forEach(tc => {
|
|
106
|
+
const isCompositeTC = tc instanceof ObjectTypeComposer || tc instanceof InterfaceTypeComposer;
|
|
107
|
+
if (isCompositeTC && !excluded.has(tc.getTypeName())) {
|
|
108
|
+
// typeComposer.getType() actually mutates the underlying GraphQL type
|
|
109
|
+
// and always re-assigns type._fields with a thunk.
|
|
110
|
+
// It causes continuous redundant field re-definitions when running queries
|
|
111
|
+
// (affects performance significantly).
|
|
112
|
+
// Prevent the mutation and "freeze" the type:
|
|
113
|
+
const type = tc.getType();
|
|
114
|
+
tc.getType = () => type;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
const updateSchemaComposer = async ({
|
|
119
|
+
schemaComposer,
|
|
120
|
+
types,
|
|
121
|
+
typeMapping,
|
|
122
|
+
fieldExtensions,
|
|
123
|
+
thirdPartySchemas,
|
|
124
|
+
printConfig,
|
|
125
|
+
enginePrintConfig,
|
|
126
|
+
typeConflictReporter,
|
|
127
|
+
inferenceMetadata,
|
|
128
|
+
parentSpan
|
|
129
|
+
}) => {
|
|
130
|
+
let activity = report.phantomActivity(`Add explicit types`, {
|
|
131
|
+
parentSpan: parentSpan
|
|
132
|
+
});
|
|
133
|
+
activity.start();
|
|
134
|
+
await addTypes({
|
|
135
|
+
schemaComposer,
|
|
136
|
+
parentSpan: activity.span,
|
|
137
|
+
types
|
|
138
|
+
});
|
|
139
|
+
activity.end();
|
|
140
|
+
activity = report.phantomActivity(`Add inferred types`, {
|
|
141
|
+
parentSpan: parentSpan
|
|
142
|
+
});
|
|
143
|
+
activity.start();
|
|
144
|
+
await addInferredTypes({
|
|
145
|
+
schemaComposer,
|
|
146
|
+
typeConflictReporter,
|
|
147
|
+
typeMapping,
|
|
148
|
+
inferenceMetadata,
|
|
149
|
+
parentSpan: activity.span
|
|
150
|
+
});
|
|
151
|
+
addInferredChildOfExtensions({
|
|
152
|
+
schemaComposer
|
|
153
|
+
});
|
|
154
|
+
activity.end();
|
|
155
|
+
activity = report.phantomActivity(`Processing types`, {
|
|
156
|
+
parentSpan: parentSpan
|
|
157
|
+
});
|
|
158
|
+
activity.start();
|
|
159
|
+
if (!process.env.GATSBY_SKIP_WRITING_SCHEMA_TO_FILE) {
|
|
160
|
+
await printTypeDefinitions({
|
|
161
|
+
config: printConfig,
|
|
162
|
+
schemaComposer,
|
|
163
|
+
parentSpan: activity.span
|
|
164
|
+
});
|
|
165
|
+
if (enginePrintConfig) {
|
|
166
|
+
// make sure to print schema that will be used when bundling graphql-engine
|
|
167
|
+
await printTypeDefinitions({
|
|
168
|
+
config: enginePrintConfig,
|
|
169
|
+
schemaComposer,
|
|
170
|
+
parentSpan: activity.span
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
await addSetFieldsOnGraphQLNodeTypeFields({
|
|
175
|
+
schemaComposer,
|
|
176
|
+
parentSpan: activity.span
|
|
177
|
+
});
|
|
178
|
+
await addConvenienceChildrenFields({
|
|
179
|
+
schemaComposer,
|
|
180
|
+
parentSpan: activity.span
|
|
181
|
+
});
|
|
182
|
+
await Promise.all(Array.from(new Set(schemaComposer.values())).map(typeComposer => processTypeComposer({
|
|
183
|
+
schemaComposer,
|
|
184
|
+
typeComposer,
|
|
185
|
+
fieldExtensions,
|
|
186
|
+
parentSpan: activity.span
|
|
187
|
+
})));
|
|
188
|
+
checkQueryableInterfaces({
|
|
189
|
+
schemaComposer,
|
|
190
|
+
parentSpan: activity.span
|
|
191
|
+
});
|
|
192
|
+
await addThirdPartySchemas({
|
|
193
|
+
schemaComposer,
|
|
194
|
+
thirdPartySchemas,
|
|
195
|
+
parentSpan: activity.span
|
|
196
|
+
});
|
|
197
|
+
await addCustomResolveFunctions({
|
|
198
|
+
schemaComposer,
|
|
199
|
+
parentSpan: activity.span
|
|
200
|
+
});
|
|
201
|
+
attachTracingResolver({
|
|
202
|
+
schemaComposer,
|
|
203
|
+
parentSpan: activity.span
|
|
204
|
+
});
|
|
205
|
+
activity.end();
|
|
206
|
+
};
|
|
207
|
+
const processTypeComposer = async ({
|
|
208
|
+
schemaComposer,
|
|
209
|
+
typeComposer,
|
|
210
|
+
fieldExtensions,
|
|
211
|
+
parentSpan
|
|
212
|
+
}) => {
|
|
213
|
+
if (typeComposer instanceof ObjectTypeComposer) {
|
|
214
|
+
await processFieldExtensions({
|
|
215
|
+
schemaComposer,
|
|
216
|
+
typeComposer,
|
|
217
|
+
fieldExtensions,
|
|
218
|
+
parentSpan
|
|
219
|
+
});
|
|
220
|
+
if (typeComposer.hasInterface(`Node`)) {
|
|
221
|
+
await addNodeInterfaceFields({
|
|
222
|
+
schemaComposer,
|
|
223
|
+
typeComposer
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
if (typeComposer.hasInterface(`RemoteFile`)) {
|
|
227
|
+
addRemoteFileInterfaceFields(schemaComposer, typeComposer);
|
|
228
|
+
}
|
|
229
|
+
await determineSearchableFields({
|
|
230
|
+
schemaComposer,
|
|
231
|
+
typeComposer,
|
|
232
|
+
parentSpan
|
|
233
|
+
});
|
|
234
|
+
if (typeComposer.hasInterface(`Node`)) {
|
|
235
|
+
await addTypeToRootQuery({
|
|
236
|
+
schemaComposer,
|
|
237
|
+
typeComposer,
|
|
238
|
+
parentSpan
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
} else if (typeComposer instanceof InterfaceTypeComposer) {
|
|
242
|
+
if (isNodeInterface(typeComposer)) {
|
|
243
|
+
await addNodeInterfaceFields({
|
|
244
|
+
schemaComposer,
|
|
245
|
+
typeComposer,
|
|
246
|
+
parentSpan
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// We only process field extensions for queryable Node interfaces, so we get
|
|
250
|
+
// the input args on the root query type, e.g. `formatString` etc. for `dateformat`
|
|
251
|
+
await processFieldExtensions({
|
|
252
|
+
schemaComposer,
|
|
253
|
+
typeComposer,
|
|
254
|
+
fieldExtensions,
|
|
255
|
+
parentSpan
|
|
256
|
+
});
|
|
257
|
+
await determineSearchableFields({
|
|
258
|
+
schemaComposer,
|
|
259
|
+
typeComposer,
|
|
260
|
+
parentSpan
|
|
261
|
+
});
|
|
262
|
+
await addTypeToRootQuery({
|
|
263
|
+
schemaComposer,
|
|
264
|
+
typeComposer,
|
|
265
|
+
parentSpan
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const fieldNames = {
|
|
271
|
+
query: typeName => _.camelCase(typeName),
|
|
272
|
+
queryAll: typeName => _.camelCase(`all ${typeName}`),
|
|
273
|
+
convenienceChild: typeName => _.camelCase(`child ${typeName}`),
|
|
274
|
+
convenienceChildren: typeName => _.camelCase(`children ${typeName}`)
|
|
275
|
+
};
|
|
276
|
+
const addTypes = ({
|
|
277
|
+
schemaComposer,
|
|
278
|
+
types,
|
|
279
|
+
parentSpan
|
|
280
|
+
}) => {
|
|
281
|
+
types.forEach(({
|
|
282
|
+
typeOrTypeDef,
|
|
283
|
+
plugin
|
|
284
|
+
}) => {
|
|
285
|
+
if (typeof typeOrTypeDef === `string`) {
|
|
286
|
+
typeOrTypeDef = parseTypeDef(typeOrTypeDef);
|
|
287
|
+
}
|
|
288
|
+
if (isASTDocument(typeOrTypeDef)) {
|
|
289
|
+
let parsedTypes;
|
|
290
|
+
const createdFrom = `sdl`;
|
|
291
|
+
try {
|
|
292
|
+
parsedTypes = parseTypes({
|
|
293
|
+
doc: typeOrTypeDef,
|
|
294
|
+
plugin,
|
|
295
|
+
createdFrom,
|
|
296
|
+
schemaComposer,
|
|
297
|
+
parentSpan
|
|
298
|
+
});
|
|
299
|
+
} catch (error) {
|
|
300
|
+
reportParsingError(error);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
parsedTypes.forEach(type => {
|
|
304
|
+
processAddedType({
|
|
305
|
+
schemaComposer,
|
|
306
|
+
type,
|
|
307
|
+
parentSpan,
|
|
308
|
+
createdFrom,
|
|
309
|
+
plugin
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
} else if ((0, _typeBuilders.isGatsbyType)(typeOrTypeDef)) {
|
|
313
|
+
const type = createTypeComposerFromGatsbyType({
|
|
314
|
+
schemaComposer,
|
|
315
|
+
type: typeOrTypeDef,
|
|
316
|
+
parentSpan
|
|
317
|
+
});
|
|
318
|
+
if (type) {
|
|
319
|
+
const typeName = type.getTypeName();
|
|
320
|
+
const createdFrom = `typeBuilder`;
|
|
321
|
+
checkIsAllowedTypeName(typeName);
|
|
322
|
+
if (schemaComposer.has(typeName)) {
|
|
323
|
+
const typeComposer = schemaComposer.get(typeName);
|
|
324
|
+
mergeTypes({
|
|
325
|
+
schemaComposer,
|
|
326
|
+
typeComposer,
|
|
327
|
+
type,
|
|
328
|
+
plugin,
|
|
329
|
+
createdFrom,
|
|
330
|
+
parentSpan
|
|
331
|
+
});
|
|
332
|
+
} else {
|
|
333
|
+
processAddedType({
|
|
334
|
+
schemaComposer,
|
|
335
|
+
type,
|
|
336
|
+
parentSpan,
|
|
337
|
+
createdFrom,
|
|
338
|
+
plugin
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
} else {
|
|
343
|
+
const typeName = typeOrTypeDef.name;
|
|
344
|
+
const createdFrom = `graphql-js`;
|
|
345
|
+
checkIsAllowedTypeName(typeName);
|
|
346
|
+
if (schemaComposer.has(typeName)) {
|
|
347
|
+
const typeComposer = schemaComposer.get(typeName);
|
|
348
|
+
mergeTypes({
|
|
349
|
+
schemaComposer,
|
|
350
|
+
typeComposer,
|
|
351
|
+
type: typeOrTypeDef,
|
|
352
|
+
plugin,
|
|
353
|
+
createdFrom,
|
|
354
|
+
parentSpan
|
|
355
|
+
});
|
|
356
|
+
} else {
|
|
357
|
+
processAddedType({
|
|
358
|
+
schemaComposer,
|
|
359
|
+
type: typeOrTypeDef,
|
|
360
|
+
parentSpan,
|
|
361
|
+
createdFrom,
|
|
362
|
+
plugin
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
const mergeTypes = ({
|
|
369
|
+
schemaComposer,
|
|
370
|
+
typeComposer,
|
|
371
|
+
type,
|
|
372
|
+
plugin,
|
|
373
|
+
createdFrom,
|
|
374
|
+
parentSpan
|
|
375
|
+
}) => {
|
|
376
|
+
// The merge is considered safe when a user or a plugin owning the type extend this type
|
|
377
|
+
// TODO: add proper conflicts detection and reporting (on the field level)
|
|
378
|
+
const typeOwner = typeComposer.getExtension(`plugin`);
|
|
379
|
+
const isOverridableBuiltInType = !typeOwner && overridableBuiltInTypeNames.has(typeComposer.getTypeName());
|
|
380
|
+
const isSafeMerge = !plugin || plugin.name === `default-site-plugin` || plugin.name === typeOwner || typeComposer.hasExtension(`isPlaceholder`) || isOverridableBuiltInType;
|
|
381
|
+
if (!isSafeMerge) {
|
|
382
|
+
if (typeOwner) {
|
|
383
|
+
report.warn(`Plugin \`${plugin.name}\` has customized the GraphQL type ` + `\`${typeComposer.getTypeName()}\`, which has already been defined ` + `by the plugin \`${typeOwner}\`. ` + `This could potentially cause conflicts.`);
|
|
384
|
+
} else {
|
|
385
|
+
report.warn(`Plugin \`${plugin.name}\` has customized the built-in Gatsby GraphQL type ` + `\`${typeComposer.getTypeName()}\`. ` + `This is allowed, but could potentially cause conflicts.`);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
if (type instanceof ObjectTypeComposer || type instanceof InterfaceTypeComposer || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) {
|
|
389
|
+
mergeFields({
|
|
390
|
+
typeComposer,
|
|
391
|
+
fields: type.getFields()
|
|
392
|
+
});
|
|
393
|
+
type.getInterfaces().forEach(iface => typeComposer.addInterface(iface));
|
|
394
|
+
}
|
|
395
|
+
if (type instanceof GraphQLInterfaceType || type instanceof InterfaceTypeComposer || type instanceof GraphQLUnionType || type instanceof UnionTypeComposer) {
|
|
396
|
+
mergeResolveType({
|
|
397
|
+
typeComposer,
|
|
398
|
+
type
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
let extensions = {};
|
|
402
|
+
if (isNamedTypeComposer(type)) {
|
|
403
|
+
if (createdFrom === `sdl`) {
|
|
404
|
+
extensions = convertDirectivesToExtensions(type, type.getDirectives());
|
|
405
|
+
} else {
|
|
406
|
+
typeComposer.extendExtensions(type.getExtensions());
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
addExtensions({
|
|
410
|
+
schemaComposer,
|
|
411
|
+
typeComposer,
|
|
412
|
+
extensions,
|
|
413
|
+
plugin,
|
|
414
|
+
createdFrom
|
|
415
|
+
});
|
|
416
|
+
return true;
|
|
417
|
+
};
|
|
418
|
+
const processAddedType = ({
|
|
419
|
+
schemaComposer,
|
|
420
|
+
type,
|
|
421
|
+
parentSpan,
|
|
422
|
+
createdFrom,
|
|
423
|
+
plugin
|
|
424
|
+
}) => {
|
|
425
|
+
const typeName = schemaComposer.add(type);
|
|
426
|
+
const typeComposer = schemaComposer.get(typeName);
|
|
427
|
+
if (typeComposer instanceof InterfaceTypeComposer || typeComposer instanceof UnionTypeComposer) {
|
|
428
|
+
if (!typeComposer.getResolveType()) {
|
|
429
|
+
typeComposer.setResolveType(node => node.internal.type);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
schemaComposer.addSchemaMustHaveType(typeComposer);
|
|
433
|
+
let extensions = {};
|
|
434
|
+
if (createdFrom === `sdl`) {
|
|
435
|
+
extensions = convertDirectivesToExtensions(typeComposer, typeComposer.getDirectives());
|
|
436
|
+
}
|
|
437
|
+
addExtensions({
|
|
438
|
+
schemaComposer,
|
|
439
|
+
typeComposer,
|
|
440
|
+
extensions,
|
|
441
|
+
plugin,
|
|
442
|
+
createdFrom
|
|
443
|
+
});
|
|
444
|
+
return typeComposer;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* @param {import("graphql-compose").AnyTypeComposer} typeComposer
|
|
449
|
+
* @param {Array<import("graphql-compose").Directive>} directives
|
|
450
|
+
* @return {{infer?: boolean, mimeTypes?: { types: Array<string> }, childOf?: { types: Array<string> }, nodeInterface?: boolean}}
|
|
451
|
+
*/
|
|
452
|
+
const convertDirectivesToExtensions = (typeComposer, directives) => {
|
|
453
|
+
const extensions = {};
|
|
454
|
+
directives.forEach(({
|
|
455
|
+
name,
|
|
456
|
+
args
|
|
457
|
+
}) => {
|
|
458
|
+
switch (name) {
|
|
459
|
+
case `infer`:
|
|
460
|
+
case `dontInfer`:
|
|
461
|
+
{
|
|
462
|
+
extensions[`infer`] = name === `infer`;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
case `mimeTypes`:
|
|
466
|
+
extensions[`mimeTypes`] = args;
|
|
467
|
+
break;
|
|
468
|
+
case `childOf`:
|
|
469
|
+
extensions[`childOf`] = args;
|
|
470
|
+
break;
|
|
471
|
+
case `nodeInterface`:
|
|
472
|
+
if (typeComposer instanceof InterfaceTypeComposer) {
|
|
473
|
+
extensions[`nodeInterface`] = true;
|
|
474
|
+
}
|
|
475
|
+
break;
|
|
476
|
+
default:
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
return extensions;
|
|
480
|
+
};
|
|
481
|
+
const addExtensions = ({
|
|
482
|
+
schemaComposer,
|
|
483
|
+
typeComposer,
|
|
484
|
+
extensions = {},
|
|
485
|
+
plugin,
|
|
486
|
+
createdFrom
|
|
487
|
+
}) => {
|
|
488
|
+
typeComposer.setExtension(`createdFrom`, createdFrom);
|
|
489
|
+
typeComposer.setExtension(`plugin`, plugin ? plugin.name : null);
|
|
490
|
+
typeComposer.extendExtensions(extensions);
|
|
491
|
+
if (typeComposer instanceof InterfaceTypeComposer && isNodeInterface(typeComposer)) {
|
|
492
|
+
const hasCorrectIdField = typeComposer.hasField(`id`) && typeComposer.getFieldType(`id`).toString() === `ID!`;
|
|
493
|
+
if (!hasCorrectIdField) {
|
|
494
|
+
report.panic(`Interfaces with the \`nodeInterface\` extension must have a field ` + `\`id\` of type \`ID!\`. Check the type definition of ` + `\`${typeComposer.getTypeName()}\`.`);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (typeComposer instanceof ObjectTypeComposer || typeComposer instanceof InterfaceTypeComposer || typeComposer instanceof InputTypeComposer) {
|
|
498
|
+
typeComposer.getFieldNames().forEach(fieldName => {
|
|
499
|
+
typeComposer.setFieldExtension(fieldName, `createdFrom`, createdFrom);
|
|
500
|
+
typeComposer.setFieldExtension(fieldName, `plugin`, plugin ? plugin.name : null);
|
|
501
|
+
if (createdFrom === `sdl`) {
|
|
502
|
+
const directives = typeComposer.getFieldDirectives(fieldName);
|
|
503
|
+
directives.forEach(({
|
|
504
|
+
name,
|
|
505
|
+
args
|
|
506
|
+
}) => {
|
|
507
|
+
typeComposer.setFieldExtension(fieldName, name, args);
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// Validate field extension args. `graphql-compose` already checks the
|
|
512
|
+
// type of directive args in `parseDirectives`, but we want to check
|
|
513
|
+
// extensions provided with type builders as well. Also, we warn if an
|
|
514
|
+
// extension option was provided which does not exist in the field
|
|
515
|
+
// extension definition.
|
|
516
|
+
const fieldExtensions = typeComposer.getFieldExtensions(fieldName);
|
|
517
|
+
const typeName = typeComposer.getTypeName();
|
|
518
|
+
Object.keys(fieldExtensions).filter(name => !internalExtensionNames.includes(name)).forEach(name => {
|
|
519
|
+
const args = fieldExtensions[name];
|
|
520
|
+
if (!args || typeof args !== `object`) {
|
|
521
|
+
report.error(`Field extension arguments must be provided as an object. ` + `Received "${args}" on \`${typeName}.${fieldName}\`.`);
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
try {
|
|
525
|
+
const definition = schemaComposer.getDirective(name);
|
|
526
|
+
|
|
527
|
+
// Handle `defaultValue` when not provided as directive
|
|
528
|
+
definition.args.forEach(({
|
|
529
|
+
name,
|
|
530
|
+
defaultValue
|
|
531
|
+
}) => {
|
|
532
|
+
if (args[name] === undefined && defaultValue !== undefined) {
|
|
533
|
+
args[name] = defaultValue;
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
Object.keys(args).forEach(arg => {
|
|
537
|
+
const argumentDef = definition.args.find(({
|
|
538
|
+
name
|
|
539
|
+
}) => name === arg);
|
|
540
|
+
if (!argumentDef) {
|
|
541
|
+
report.error(`Field extension \`${name}\` on \`${typeName}.${fieldName}\` ` + `has invalid argument \`${arg}\`.`);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
const value = args[arg];
|
|
545
|
+
try {
|
|
546
|
+
validate(argumentDef.type, value);
|
|
547
|
+
} catch (error) {
|
|
548
|
+
report.error(`Field extension \`${name}\` on \`${typeName}.${fieldName}\` ` + `has argument \`${arg}\` with invalid value "${value}". ` + error.message);
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
} catch (error) {
|
|
552
|
+
report.error(`Field extension \`${name}\` on \`${typeName}.${fieldName}\` ` + `is not available.`);
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
return typeComposer;
|
|
558
|
+
};
|
|
559
|
+
const checkIsAllowedTypeName = name => {
|
|
560
|
+
invariant(name !== `Node`, `The GraphQL type \`Node\` is reserved for internal use.`);
|
|
561
|
+
invariant(!name.endsWith(`FilterInput`) && !name.endsWith(`SortInput`), `GraphQL type names ending with "FilterInput" or "SortInput" are ` + `reserved for internal use. Please rename \`${name}\`.`);
|
|
562
|
+
invariant(!builtInScalarTypeNames.includes(name), `The GraphQL type \`${name}\` is reserved for internal use by ` + `built-in scalar types.`);
|
|
563
|
+
assertValidName(name);
|
|
564
|
+
};
|
|
565
|
+
const createTypeComposerFromGatsbyType = ({
|
|
566
|
+
schemaComposer,
|
|
567
|
+
type,
|
|
568
|
+
parentSpan
|
|
569
|
+
}) => {
|
|
570
|
+
let typeComposer;
|
|
571
|
+
switch (type.kind) {
|
|
572
|
+
case _typeBuilders.GatsbyGraphQLTypeKind.OBJECT:
|
|
573
|
+
{
|
|
574
|
+
typeComposer = ObjectTypeComposer.createTemp({
|
|
575
|
+
...type.config,
|
|
576
|
+
fields: () => schemaComposer.typeMapper.convertOutputFieldConfigMap(type.config.fields),
|
|
577
|
+
interfaces: () => {
|
|
578
|
+
if (type.config.interfaces) {
|
|
579
|
+
return type.config.interfaces.map(iface => {
|
|
580
|
+
if (typeof iface === `string`) {
|
|
581
|
+
// Sadly, graphql-compose runs this function too early - before we have
|
|
582
|
+
// all of those interfaces actually created in the schema, so have to create
|
|
583
|
+
// a temporary placeholder composer :/
|
|
584
|
+
if (!schemaComposer.has(iface)) {
|
|
585
|
+
const tmpComposer = schemaComposer.createInterfaceTC(iface);
|
|
586
|
+
tmpComposer.setExtension(`isPlaceholder`, true);
|
|
587
|
+
return tmpComposer;
|
|
588
|
+
}
|
|
589
|
+
return schemaComposer.getIFTC(iface);
|
|
590
|
+
} else {
|
|
591
|
+
return iface;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
} else {
|
|
595
|
+
return [];
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
case _typeBuilders.GatsbyGraphQLTypeKind.INPUT_OBJECT:
|
|
602
|
+
{
|
|
603
|
+
typeComposer = InputTypeComposer.createTemp({
|
|
604
|
+
...type.config,
|
|
605
|
+
fields: schemaComposer.typeMapper.convertInputFieldConfigMap(type.config.fields)
|
|
606
|
+
});
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
case _typeBuilders.GatsbyGraphQLTypeKind.UNION:
|
|
610
|
+
{
|
|
611
|
+
typeComposer = UnionTypeComposer.createTemp({
|
|
612
|
+
...type.config,
|
|
613
|
+
types: () => {
|
|
614
|
+
if (type.config.types) {
|
|
615
|
+
return type.config.types.map(typeName => {
|
|
616
|
+
if (!schemaComposer.has(typeName)) {
|
|
617
|
+
// Sadly, graphql-compose runs this function too early - before we have
|
|
618
|
+
// all of those types actually created in the schema, so have to create
|
|
619
|
+
// a temporary placeholder composer :/
|
|
620
|
+
const tmpComposer = schemaComposer.createObjectTC(typeName);
|
|
621
|
+
tmpComposer.setExtension(`isPlaceholder`, true);
|
|
622
|
+
return tmpComposer;
|
|
623
|
+
}
|
|
624
|
+
return schemaComposer.getOTC(typeName);
|
|
625
|
+
});
|
|
626
|
+
} else {
|
|
627
|
+
return [];
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
case _typeBuilders.GatsbyGraphQLTypeKind.INTERFACE:
|
|
634
|
+
{
|
|
635
|
+
typeComposer = InterfaceTypeComposer.createTemp({
|
|
636
|
+
...type.config,
|
|
637
|
+
fields: () => schemaComposer.typeMapper.convertOutputFieldConfigMap(type.config.fields),
|
|
638
|
+
interfaces: () => {
|
|
639
|
+
if (type.config.interfaces) {
|
|
640
|
+
return type.config.interfaces.map(iface => {
|
|
641
|
+
if (typeof iface === `string`) {
|
|
642
|
+
// Sadly, graphql-compose runs this function too early - before we have
|
|
643
|
+
// all of those interfaces actually created in the schema, so have to create
|
|
644
|
+
// a temporary placeholder composer :/
|
|
645
|
+
if (!schemaComposer.has(iface)) {
|
|
646
|
+
const tmpComposer = schemaComposer.createInterfaceTC(iface);
|
|
647
|
+
tmpComposer.setExtension(`isPlaceholder`, true);
|
|
648
|
+
return tmpComposer;
|
|
649
|
+
}
|
|
650
|
+
return schemaComposer.getIFTC(iface);
|
|
651
|
+
} else {
|
|
652
|
+
return iface;
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
} else {
|
|
656
|
+
return [];
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
case _typeBuilders.GatsbyGraphQLTypeKind.ENUM:
|
|
663
|
+
{
|
|
664
|
+
typeComposer = EnumTypeComposer.createTemp(type.config);
|
|
665
|
+
break;
|
|
666
|
+
}
|
|
667
|
+
case _typeBuilders.GatsbyGraphQLTypeKind.SCALAR:
|
|
668
|
+
{
|
|
669
|
+
typeComposer = ScalarTypeComposer.createTemp(type.config);
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
default:
|
|
673
|
+
{
|
|
674
|
+
report.warn(`Illegal type definition: ${JSON.stringify(type.config)}`);
|
|
675
|
+
typeComposer = null;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
if (typeComposer) {
|
|
679
|
+
// Workaround for https://github.com/graphql-compose/graphql-compose/issues/311
|
|
680
|
+
typeComposer.schemaComposer = schemaComposer;
|
|
681
|
+
}
|
|
682
|
+
return typeComposer;
|
|
683
|
+
};
|
|
684
|
+
const addSetFieldsOnGraphQLNodeTypeFields = ({
|
|
685
|
+
schemaComposer,
|
|
686
|
+
parentSpan
|
|
687
|
+
}) => Promise.all(Array.from(schemaComposer.values()).map(async tc => {
|
|
688
|
+
if (tc instanceof ObjectTypeComposer && tc.hasInterface(`Node`)) {
|
|
689
|
+
const typeName = tc.getTypeName();
|
|
690
|
+
const result = await apiRunner(`setFieldsOnGraphQLNodeType`, {
|
|
691
|
+
type: {
|
|
692
|
+
name: typeName,
|
|
693
|
+
get nodes() {
|
|
694
|
+
// TODO STRICT_MODE: return iterator instead of array
|
|
695
|
+
return getNodesByType(typeName);
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
traceId: `initial-setFieldsOnGraphQLNodeType`,
|
|
699
|
+
parentSpan
|
|
700
|
+
});
|
|
701
|
+
if (result) {
|
|
702
|
+
// NOTE: `setFieldsOnGraphQLNodeType` only allows setting
|
|
703
|
+
// nested fields with a path as property name, i.e.
|
|
704
|
+
// `{ 'frontmatter.published': 'Boolean' }`, but not in the form
|
|
705
|
+
// `{ frontmatter: { published: 'Boolean' }}`
|
|
706
|
+
result.forEach(fields => tc.addNestedFields(fields));
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}));
|
|
710
|
+
const addThirdPartySchemas = ({
|
|
711
|
+
schemaComposer,
|
|
712
|
+
thirdPartySchemas,
|
|
713
|
+
parentSpan
|
|
714
|
+
}) => {
|
|
715
|
+
thirdPartySchemas.forEach(schema => {
|
|
716
|
+
const schemaQueryType = schema.getQueryType();
|
|
717
|
+
const queryTC = schemaComposer.createTempTC(schemaQueryType);
|
|
718
|
+
processThirdPartyTypeFields({
|
|
719
|
+
typeComposer: queryTC,
|
|
720
|
+
type: schemaQueryType,
|
|
721
|
+
schemaQueryType
|
|
722
|
+
});
|
|
723
|
+
schemaComposer.Query.addFields(queryTC.getFields());
|
|
724
|
+
|
|
725
|
+
// Explicitly add the third-party schema's types, so they can be targeted
|
|
726
|
+
// in `createResolvers` API.
|
|
727
|
+
const types = schema.getTypeMap();
|
|
728
|
+
Object.keys(types).forEach(typeName => {
|
|
729
|
+
const type = types[typeName];
|
|
730
|
+
if (type !== schemaQueryType && !isSpecifiedScalarType(type) && !isIntrospectionType(type) && type.name !== `Date` && type.name !== `JSON`) {
|
|
731
|
+
const typeHasFields = type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType;
|
|
732
|
+
|
|
733
|
+
// Workaround for an edge case typical for Relay Classic-compatible schemas.
|
|
734
|
+
// For example, GitHub API contains this piece:
|
|
735
|
+
// type Query { relay: Query }
|
|
736
|
+
// And gatsby-source-graphql transforms it to:
|
|
737
|
+
// type Query { github: GitHub }
|
|
738
|
+
// type GitHub { relay: Query }
|
|
739
|
+
// The problem:
|
|
740
|
+
// schemaComposer.createTC(type) for type `GitHub` will eagerly create type composers
|
|
741
|
+
// for all fields (including `relay` and it's type: `Query` of the third-party schema)
|
|
742
|
+
// This unexpected `Query` composer messes up with our own Query type composer and produces duplicate types.
|
|
743
|
+
// The workaround is to make sure fields of the GitHub type are lazy and are evaluated only when
|
|
744
|
+
// this Query type is already replaced with our own root `Query` type (see processThirdPartyTypeFields):
|
|
745
|
+
if (typeHasFields && typeof type._fields === `object`) {
|
|
746
|
+
const fields = type._fields;
|
|
747
|
+
type._fields = () => fields;
|
|
748
|
+
}
|
|
749
|
+
// ^^^ workaround done
|
|
750
|
+
const typeComposer = schemaComposer.createTC(type);
|
|
751
|
+
if (typeHasFields) {
|
|
752
|
+
processThirdPartyTypeFields({
|
|
753
|
+
typeComposer,
|
|
754
|
+
type,
|
|
755
|
+
schemaQueryType
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
typeComposer.setExtension(`createdFrom`, `thirdPartySchema`);
|
|
759
|
+
schemaComposer.addSchemaMustHaveType(typeComposer);
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
};
|
|
764
|
+
const resetOverriddenThirdPartyTypeFields = ({
|
|
765
|
+
typeComposer
|
|
766
|
+
}) => {
|
|
767
|
+
// The problem: createResolvers API mutates third party schema instance.
|
|
768
|
+
// For example it can add a new field referencing a type from our main schema
|
|
769
|
+
// Then if we rebuild the schema this old type instance will sneak into
|
|
770
|
+
// the new schema and produce the famous error:
|
|
771
|
+
// "Schema must contain uniquely named types but contains multiple types named X"
|
|
772
|
+
// This function only affects schema rebuilding pathway.
|
|
773
|
+
// It cleans up artifacts created by the `createResolvers` API of the previous build
|
|
774
|
+
// so that we return the third party schema to its initial state (hence can safely re-add)
|
|
775
|
+
// TODO: the right way to fix this would be not to mutate the third party schema in
|
|
776
|
+
// the first place. But unfortunately mutation happens in the `graphql-compose`
|
|
777
|
+
// and we don't have an easy way to avoid it without major rework
|
|
778
|
+
typeComposer.getFieldNames().forEach(fieldName => {
|
|
779
|
+
const createdFrom = typeComposer.getFieldExtension(fieldName, `createdFrom`);
|
|
780
|
+
if (createdFrom === `createResolvers`) {
|
|
781
|
+
typeComposer.removeField(fieldName);
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
const config = typeComposer.getFieldExtension(fieldName, `originalFieldConfig`);
|
|
785
|
+
if (config) {
|
|
786
|
+
typeComposer.removeField(fieldName);
|
|
787
|
+
typeComposer.addFields({
|
|
788
|
+
[fieldName]: config
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
};
|
|
793
|
+
const processThirdPartyTypeFields = ({
|
|
794
|
+
typeComposer,
|
|
795
|
+
type,
|
|
796
|
+
schemaQueryType
|
|
797
|
+
}) => {
|
|
798
|
+
// Fix for types that refer to Query. Thanks Relay Classic!
|
|
799
|
+
const fields = type.getFields();
|
|
800
|
+
Object.keys(fields).forEach(fieldName => {
|
|
801
|
+
// Remove customization that we could have added via `createResolvers`
|
|
802
|
+
// to make it work with schema rebuilding
|
|
803
|
+
const fieldType = String(fields[fieldName].type);
|
|
804
|
+
if (fieldType.replace(/[[\]!]/g, ``) === schemaQueryType.name) {
|
|
805
|
+
typeComposer.extendField(fieldName, {
|
|
806
|
+
type: fieldType.replace(schemaQueryType.name, `Query`)
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
resetOverriddenThirdPartyTypeFields({
|
|
811
|
+
typeComposer
|
|
812
|
+
});
|
|
813
|
+
};
|
|
814
|
+
const addCustomResolveFunctions = async ({
|
|
815
|
+
schemaComposer,
|
|
816
|
+
parentSpan
|
|
817
|
+
}) => {
|
|
818
|
+
const intermediateSchema = schemaComposer.buildSchema();
|
|
819
|
+
const createResolvers = (resolvers, {
|
|
820
|
+
ignoreNonexistentTypes = false
|
|
821
|
+
} = {}) => {
|
|
822
|
+
Object.keys(resolvers).forEach(typeName => {
|
|
823
|
+
const fields = resolvers[typeName];
|
|
824
|
+
if (schemaComposer.has(typeName)) {
|
|
825
|
+
const tc = schemaComposer.getOTC(typeName);
|
|
826
|
+
Object.keys(fields).forEach(fieldName => {
|
|
827
|
+
const fieldConfig = fields[fieldName];
|
|
828
|
+
if (tc.hasField(fieldName)) {
|
|
829
|
+
const originalFieldConfig = tc.getFieldConfig(fieldName);
|
|
830
|
+
const originalTypeName = originalFieldConfig.type.toString();
|
|
831
|
+
const originalResolver = originalFieldConfig.resolve;
|
|
832
|
+
let fieldTypeName;
|
|
833
|
+
if (fieldConfig.type) {
|
|
834
|
+
fieldTypeName = Array.isArray(fieldConfig.type) ? stringifyArray(fieldConfig.type) : fieldConfig.type.toString();
|
|
835
|
+
}
|
|
836
|
+
if (!fieldTypeName || fieldTypeName.replace(/!/g, ``) === originalTypeName.replace(/!/g, ``) || tc.getExtension(`createdFrom`) === `thirdPartySchema`) {
|
|
837
|
+
const newConfig = {};
|
|
838
|
+
if (fieldConfig.type) {
|
|
839
|
+
newConfig.type = fieldConfig.type;
|
|
840
|
+
}
|
|
841
|
+
if (fieldConfig.args) {
|
|
842
|
+
newConfig.args = fieldConfig.args;
|
|
843
|
+
}
|
|
844
|
+
if (fieldConfig.resolve) {
|
|
845
|
+
newConfig.resolve = (source, args, context, info) => fieldConfig.resolve(source, args, context, {
|
|
846
|
+
...info,
|
|
847
|
+
originalResolver: originalResolver || context.defaultFieldResolver
|
|
848
|
+
});
|
|
849
|
+
tc.extendFieldExtensions(fieldName, {
|
|
850
|
+
needsResolve: true
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
tc.extendField(fieldName, newConfig);
|
|
854
|
+
|
|
855
|
+
// See resetOverriddenThirdPartyTypeFields for explanation
|
|
856
|
+
if (tc.getExtension(`createdFrom`) === `thirdPartySchema`) {
|
|
857
|
+
tc.setFieldExtension(fieldName, `originalFieldConfig`, originalFieldConfig);
|
|
858
|
+
}
|
|
859
|
+
} else if (fieldTypeName) {
|
|
860
|
+
report.warn(`\`createResolvers\` passed resolvers for field ` + `\`${typeName}.${fieldName}\` with type \`${fieldTypeName}\`. ` + `Such a field with type \`${originalTypeName}\` already exists ` + `on the type. Use \`createTypes\` to override type fields.`);
|
|
861
|
+
}
|
|
862
|
+
} else {
|
|
863
|
+
tc.addFields({
|
|
864
|
+
[fieldName]: fieldConfig
|
|
865
|
+
});
|
|
866
|
+
// See resetOverriddenThirdPartyTypeFields for explanation
|
|
867
|
+
tc.setFieldExtension(fieldName, `createdFrom`, `createResolvers`);
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
} else if (!ignoreNonexistentTypes) {
|
|
871
|
+
report.warn(`\`createResolvers\` passed resolvers for type \`${typeName}\` that ` + `doesn't exist in the schema. Use \`createTypes\` to add the type ` + `before adding resolvers.`);
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
};
|
|
875
|
+
await apiRunner(`createResolvers`, {
|
|
876
|
+
intermediateSchema,
|
|
877
|
+
createResolvers,
|
|
878
|
+
traceId: `initial-createResolvers`,
|
|
879
|
+
parentSpan
|
|
880
|
+
});
|
|
881
|
+
};
|
|
882
|
+
function attachTracingResolver({
|
|
883
|
+
schemaComposer
|
|
884
|
+
}) {
|
|
885
|
+
schemaComposer.forEach(typeComposer => {
|
|
886
|
+
if (typeComposer instanceof ObjectTypeComposer || typeComposer instanceof InterfaceTypeComposer) {
|
|
887
|
+
typeComposer.getFieldNames().forEach(fieldName => {
|
|
888
|
+
const field = typeComposer.getField(fieldName);
|
|
889
|
+
const resolver = wrappingResolver(field.resolve || defaultResolver);
|
|
890
|
+
typeComposer.extendField(fieldName, {
|
|
891
|
+
resolve: resolver
|
|
892
|
+
});
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
const determineSearchableFields = ({
|
|
898
|
+
schemaComposer,
|
|
899
|
+
typeComposer
|
|
900
|
+
}) => {
|
|
901
|
+
typeComposer.getFieldNames().forEach(fieldName => {
|
|
902
|
+
const field = typeComposer.getField(fieldName);
|
|
903
|
+
const extensions = typeComposer.getFieldExtensions(fieldName);
|
|
904
|
+
if (field.resolve) {
|
|
905
|
+
if (extensions.dateformat) {
|
|
906
|
+
typeComposer.extendFieldExtensions(fieldName, {
|
|
907
|
+
searchable: _filter.SEARCHABLE_ENUM.SEARCHABLE,
|
|
908
|
+
sortable: _sort.SORTABLE_ENUM.SORTABLE,
|
|
909
|
+
needsResolve: extensions.proxy ? true : false
|
|
910
|
+
});
|
|
911
|
+
} else if (!_.isEmpty(field.args)) {
|
|
912
|
+
typeComposer.extendFieldExtensions(fieldName, {
|
|
913
|
+
searchable: _filter.SEARCHABLE_ENUM.DEPRECATED_SEARCHABLE,
|
|
914
|
+
sortable: _sort.SORTABLE_ENUM.DEPRECATED_SORTABLE,
|
|
915
|
+
needsResolve: true
|
|
916
|
+
});
|
|
917
|
+
} else {
|
|
918
|
+
typeComposer.extendFieldExtensions(fieldName, {
|
|
919
|
+
searchable: _filter.SEARCHABLE_ENUM.SEARCHABLE,
|
|
920
|
+
sortable: _sort.SORTABLE_ENUM.SORTABLE,
|
|
921
|
+
needsResolve: true
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
} else {
|
|
925
|
+
typeComposer.extendFieldExtensions(fieldName, {
|
|
926
|
+
searchable: _filter.SEARCHABLE_ENUM.SEARCHABLE,
|
|
927
|
+
sortable: _sort.SORTABLE_ENUM.SORTABLE,
|
|
928
|
+
needsResolve: false
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
};
|
|
933
|
+
const addConvenienceChildrenFields = ({
|
|
934
|
+
schemaComposer
|
|
935
|
+
}) => {
|
|
936
|
+
const parentTypesToChildren = new Map();
|
|
937
|
+
const mimeTypesToChildren = new Map();
|
|
938
|
+
const typesHandlingMimeTypes = new Map();
|
|
939
|
+
schemaComposer.forEach(type => {
|
|
940
|
+
if ((type instanceof ObjectTypeComposer || type instanceof InterfaceTypeComposer) && type.hasExtension(`mimeTypes`)) {
|
|
941
|
+
const {
|
|
942
|
+
types
|
|
943
|
+
} = type.getExtension(`mimeTypes`);
|
|
944
|
+
new Set(types).forEach(mimeType => {
|
|
945
|
+
if (!typesHandlingMimeTypes.has(mimeType)) {
|
|
946
|
+
typesHandlingMimeTypes.set(mimeType, new Set());
|
|
947
|
+
}
|
|
948
|
+
typesHandlingMimeTypes.get(mimeType).add(type);
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
if ((type instanceof ObjectTypeComposer || type instanceof InterfaceTypeComposer) && type.hasExtension(`childOf`)) {
|
|
952
|
+
if (type instanceof ObjectTypeComposer && !type.hasInterface(`Node`)) {
|
|
953
|
+
report.error(`The \`childOf\` extension can only be used on types that implement the \`Node\` interface.\n` + `Check the type definition of \`${type.getTypeName()}\`.`);
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
if (type instanceof InterfaceTypeComposer && !isNodeInterface(type)) {
|
|
957
|
+
report.error(`The \`childOf\` extension can only be used on types that implement the \`Node\` interface.\n` + `Check the type definition of \`${type.getTypeName()}\`.`);
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
const {
|
|
961
|
+
types,
|
|
962
|
+
mimeTypes
|
|
963
|
+
} = type.getExtension(`childOf`);
|
|
964
|
+
new Set(types).forEach(parentType => {
|
|
965
|
+
if (!parentTypesToChildren.has(parentType)) {
|
|
966
|
+
parentTypesToChildren.set(parentType, new Set());
|
|
967
|
+
}
|
|
968
|
+
parentTypesToChildren.get(parentType).add(type);
|
|
969
|
+
});
|
|
970
|
+
new Set(mimeTypes).forEach(mimeType => {
|
|
971
|
+
if (!mimeTypesToChildren.has(mimeType)) {
|
|
972
|
+
mimeTypesToChildren.set(mimeType, new Set());
|
|
973
|
+
}
|
|
974
|
+
mimeTypesToChildren.get(mimeType).add(type);
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
parentTypesToChildren.forEach((children, parent) => {
|
|
979
|
+
if (!schemaComposer.has(parent)) return;
|
|
980
|
+
const typeComposer = schemaComposer.getAnyTC(parent);
|
|
981
|
+
if (typeComposer instanceof InterfaceTypeComposer && !isNodeInterface(typeComposer)) {
|
|
982
|
+
report.error(`With the \`childOf\` extension, children fields can only be added to ` + `interfaces which implement the \`Node\` interface.\n` + `Check the type definition of \`${typeComposer.getTypeName()}\`.`);
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
children.forEach(child => {
|
|
986
|
+
typeComposer.addFields(createChildrenField(child.getTypeName()));
|
|
987
|
+
typeComposer.addFields(createChildField(child.getTypeName()));
|
|
988
|
+
});
|
|
989
|
+
});
|
|
990
|
+
mimeTypesToChildren.forEach((children, mimeType) => {
|
|
991
|
+
const parentTypes = typesHandlingMimeTypes.get(mimeType);
|
|
992
|
+
if (parentTypes) {
|
|
993
|
+
parentTypes.forEach(typeComposer => {
|
|
994
|
+
if (typeComposer instanceof InterfaceTypeComposer && !isNodeInterface(typeComposer)) {
|
|
995
|
+
report.error(`With the \`childOf\` extension, children fields can only be added to ` + `interfaces which implement the \`Node\` interface.\n` + `Check the type definition of \`${typeComposer.getTypeName()}\`.`);
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
children.forEach(child => {
|
|
999
|
+
typeComposer.addFields(createChildrenField(child.getTypeName()));
|
|
1000
|
+
typeComposer.addFields(createChildField(child.getTypeName()));
|
|
1001
|
+
});
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
1006
|
+
const isExplicitChild = ({
|
|
1007
|
+
typeComposer,
|
|
1008
|
+
childTypeComposer
|
|
1009
|
+
}) => {
|
|
1010
|
+
var _typeComposer$getExte, _childOfExtension$typ, _childOfExtension$mim;
|
|
1011
|
+
if (!childTypeComposer.hasExtension(`childOf`)) {
|
|
1012
|
+
return false;
|
|
1013
|
+
}
|
|
1014
|
+
const childOfExtension = childTypeComposer.getExtension(`childOf`);
|
|
1015
|
+
const {
|
|
1016
|
+
types: parentMimeTypes = []
|
|
1017
|
+
} = (_typeComposer$getExte = typeComposer.getExtension(`mimeTypes`)) !== null && _typeComposer$getExte !== void 0 ? _typeComposer$getExte : {};
|
|
1018
|
+
return (childOfExtension === null || childOfExtension === void 0 ? void 0 : (_childOfExtension$typ = childOfExtension.types) === null || _childOfExtension$typ === void 0 ? void 0 : _childOfExtension$typ.includes(typeComposer.getTypeName())) || (childOfExtension === null || childOfExtension === void 0 ? void 0 : (_childOfExtension$mim = childOfExtension.mimeTypes) === null || _childOfExtension$mim === void 0 ? void 0 : _childOfExtension$mim.some(mimeType => parentMimeTypes.includes(mimeType)));
|
|
1019
|
+
};
|
|
1020
|
+
const addInferredChildOfExtensions = ({
|
|
1021
|
+
schemaComposer
|
|
1022
|
+
}) => {
|
|
1023
|
+
schemaComposer.forEach(typeComposer => {
|
|
1024
|
+
if (typeComposer instanceof ObjectTypeComposer && typeComposer.hasInterface(`Node`)) {
|
|
1025
|
+
addInferredChildOfExtension({
|
|
1026
|
+
schemaComposer,
|
|
1027
|
+
typeComposer
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
};
|
|
1032
|
+
const addInferredChildOfExtension = ({
|
|
1033
|
+
schemaComposer,
|
|
1034
|
+
typeComposer
|
|
1035
|
+
}) => {
|
|
1036
|
+
const shouldInfer = typeComposer.getExtension(`infer`);
|
|
1037
|
+
// With `@dontInfer`, only parent-child
|
|
1038
|
+
// relations explicitly set with the `@childOf` extension are added.
|
|
1039
|
+
if (shouldInfer === false) return;
|
|
1040
|
+
const parentTypeName = typeComposer.getTypeName();
|
|
1041
|
+
|
|
1042
|
+
// This is expensive.
|
|
1043
|
+
// TODO: We should probably collect this info during inference metadata pass
|
|
1044
|
+
const childNodeTypes = new Set();
|
|
1045
|
+
for (const node of getDataStore().iterateNodesByType(parentTypeName)) {
|
|
1046
|
+
const children = (node.children || []).map(getNode);
|
|
1047
|
+
for (const childNode of children) {
|
|
1048
|
+
var _childNode$internal;
|
|
1049
|
+
if (childNode !== null && childNode !== void 0 && (_childNode$internal = childNode.internal) !== null && _childNode$internal !== void 0 && _childNode$internal.type) {
|
|
1050
|
+
childNodeTypes.add(childNode.internal.type);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
childNodeTypes.forEach(typeName => {
|
|
1055
|
+
const childTypeComposer = schemaComposer.getAnyTC(typeName);
|
|
1056
|
+
let childOfExtension = childTypeComposer.getExtension(`childOf`);
|
|
1057
|
+
if (isExplicitChild({
|
|
1058
|
+
typeComposer,
|
|
1059
|
+
childTypeComposer
|
|
1060
|
+
})) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
// Set `@childOf` extension automatically
|
|
1064
|
+
// This will cause convenience children fields like `childImageSharp`
|
|
1065
|
+
// to be added in `addConvenienceChildrenFields` method.
|
|
1066
|
+
// Also required for proper printing of the `@childOf` directive in the snapshot plugin
|
|
1067
|
+
if (!childOfExtension) {
|
|
1068
|
+
childOfExtension = {};
|
|
1069
|
+
}
|
|
1070
|
+
if (!childOfExtension.types) {
|
|
1071
|
+
childOfExtension.types = [];
|
|
1072
|
+
}
|
|
1073
|
+
childOfExtension.types.push(parentTypeName);
|
|
1074
|
+
childTypeComposer.setExtension(`childOf`, childOfExtension);
|
|
1075
|
+
});
|
|
1076
|
+
};
|
|
1077
|
+
const createChildrenField = typeName => {
|
|
1078
|
+
return {
|
|
1079
|
+
[fieldNames.convenienceChildren(typeName)]: {
|
|
1080
|
+
type: () => [typeName],
|
|
1081
|
+
description: `Returns all children nodes filtered by type ${typeName}`,
|
|
1082
|
+
resolve(source, args, context) {
|
|
1083
|
+
const {
|
|
1084
|
+
path
|
|
1085
|
+
} = context;
|
|
1086
|
+
return context.nodeModel.getNodesByIds({
|
|
1087
|
+
ids: source.children,
|
|
1088
|
+
type: typeName
|
|
1089
|
+
}, {
|
|
1090
|
+
path
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
1096
|
+
const createChildField = typeName => {
|
|
1097
|
+
return {
|
|
1098
|
+
[fieldNames.convenienceChild(typeName)]: {
|
|
1099
|
+
type: () => typeName,
|
|
1100
|
+
description: `Returns the first child node of type ${typeName} ` + `or null if there are no children of given type on this node`,
|
|
1101
|
+
resolve(source, args, context) {
|
|
1102
|
+
const {
|
|
1103
|
+
path
|
|
1104
|
+
} = context;
|
|
1105
|
+
const result = context.nodeModel.getNodesByIds({
|
|
1106
|
+
ids: source.children,
|
|
1107
|
+
type: typeName
|
|
1108
|
+
}, {
|
|
1109
|
+
path
|
|
1110
|
+
});
|
|
1111
|
+
if (result && result.length > 0) {
|
|
1112
|
+
return result[0];
|
|
1113
|
+
} else {
|
|
1114
|
+
return null;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
};
|
|
1120
|
+
const addTypeToRootQuery = ({
|
|
1121
|
+
schemaComposer,
|
|
1122
|
+
typeComposer
|
|
1123
|
+
}) => {
|
|
1124
|
+
const filterInputTC = (0, _filter.getFilterInput)({
|
|
1125
|
+
schemaComposer,
|
|
1126
|
+
typeComposer
|
|
1127
|
+
});
|
|
1128
|
+
const paginationTC = (0, _pagination.getPagination)({
|
|
1129
|
+
schemaComposer,
|
|
1130
|
+
typeComposer
|
|
1131
|
+
});
|
|
1132
|
+
const typeName = typeComposer.getTypeName();
|
|
1133
|
+
// not strictly correctly, result is `npmPackage` and `allNpmPackage` from type `NPMPackage`
|
|
1134
|
+
const queryName = fieldNames.query(typeName);
|
|
1135
|
+
const queryNamePlural = fieldNames.queryAll(typeName);
|
|
1136
|
+
schemaComposer.Query.addFields({
|
|
1137
|
+
[queryName]: {
|
|
1138
|
+
type: typeComposer,
|
|
1139
|
+
args: {
|
|
1140
|
+
...filterInputTC.getFields()
|
|
1141
|
+
},
|
|
1142
|
+
resolve: findOne(typeName)
|
|
1143
|
+
},
|
|
1144
|
+
[queryNamePlural]: {
|
|
1145
|
+
type: paginationTC,
|
|
1146
|
+
args: {
|
|
1147
|
+
filter: filterInputTC,
|
|
1148
|
+
sort: "5" === `5` ? (0, _sort.getSortInputNestedObjects)({
|
|
1149
|
+
schemaComposer,
|
|
1150
|
+
typeComposer
|
|
1151
|
+
}) : (0, _sort.getSortInput)({
|
|
1152
|
+
schemaComposer,
|
|
1153
|
+
typeComposer
|
|
1154
|
+
}),
|
|
1155
|
+
skip: `Int`,
|
|
1156
|
+
limit: `Int`
|
|
1157
|
+
},
|
|
1158
|
+
resolve: findManyPaginated(typeName)
|
|
1159
|
+
}
|
|
1160
|
+
}).makeFieldNonNull(queryNamePlural);
|
|
1161
|
+
};
|
|
1162
|
+
const parseTypes = ({
|
|
1163
|
+
doc,
|
|
1164
|
+
plugin,
|
|
1165
|
+
createdFrom,
|
|
1166
|
+
schemaComposer,
|
|
1167
|
+
parentSpan
|
|
1168
|
+
}) => {
|
|
1169
|
+
const types = [];
|
|
1170
|
+
doc.definitions.forEach(def => {
|
|
1171
|
+
const name = def.name.value;
|
|
1172
|
+
checkIsAllowedTypeName(name);
|
|
1173
|
+
if (schemaComposer.has(name)) {
|
|
1174
|
+
// We don't check if ast.kind matches composer type, but rely
|
|
1175
|
+
// that this will throw when something is wrong and get
|
|
1176
|
+
// reported by `reportParsingError`.
|
|
1177
|
+
|
|
1178
|
+
// Keep the original type composer around
|
|
1179
|
+
const typeComposer = schemaComposer.get(name);
|
|
1180
|
+
|
|
1181
|
+
// After this, the parsed type composer will be registered as the composer
|
|
1182
|
+
// handling the type name (requires cleanup after merging, see below)
|
|
1183
|
+
const parsedType = schemaComposer.typeMapper.makeSchemaDef(def);
|
|
1184
|
+
|
|
1185
|
+
// Merging types require implemented interfaces to already exist.
|
|
1186
|
+
// Depending on type creation order, interface might have not been
|
|
1187
|
+
// processed yet. We check if interface already exist and create
|
|
1188
|
+
// placeholder for it, if it doesn't exist yet.
|
|
1189
|
+
if (parsedType.getInterfaces) {
|
|
1190
|
+
parsedType.getInterfaces().forEach(iface => {
|
|
1191
|
+
const ifaceName = iface.getTypeName();
|
|
1192
|
+
if (!schemaComposer.has(ifaceName)) {
|
|
1193
|
+
const tmpComposer = schemaComposer.createInterfaceTC(ifaceName);
|
|
1194
|
+
tmpComposer.setExtension(`isPlaceholder`, true);
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
// Merge the parsed type with the original
|
|
1200
|
+
mergeTypes({
|
|
1201
|
+
schemaComposer,
|
|
1202
|
+
typeComposer,
|
|
1203
|
+
type: parsedType,
|
|
1204
|
+
plugin,
|
|
1205
|
+
createdFrom,
|
|
1206
|
+
parentSpan
|
|
1207
|
+
});
|
|
1208
|
+
|
|
1209
|
+
// Cleanup:
|
|
1210
|
+
// Set the original type composer (with the merged fields added)
|
|
1211
|
+
// as the correct composer for the type name and remove the temporary one
|
|
1212
|
+
// `graphql-compose` doesn't make that easy 🤯
|
|
1213
|
+
// TODO: clean this up when this issue is fixed:
|
|
1214
|
+
// https://github.com/graphql-compose/graphql-compose/issues/311
|
|
1215
|
+
schemaComposer.set(typeComposer.getTypeName(), typeComposer);
|
|
1216
|
+
schemaComposer.set(typeComposer._gqType, typeComposer);
|
|
1217
|
+
schemaComposer.delete(parsedType._gqType);
|
|
1218
|
+
schemaComposer.delete(parsedType);
|
|
1219
|
+
} else {
|
|
1220
|
+
const parsedType = schemaComposer.typeMapper.makeSchemaDef(def);
|
|
1221
|
+
types.push(parsedType);
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
return types;
|
|
1225
|
+
};
|
|
1226
|
+
const stringifyArray = arr => `[${arr.map(item => Array.isArray(item) ? stringifyArray(item) : item.toString())}]`;
|
|
1227
|
+
|
|
1228
|
+
// TODO: Import this directly from graphql-compose once we update to v7
|
|
1229
|
+
const isNamedTypeComposer = type => type instanceof ObjectTypeComposer || type instanceof InputTypeComposer || type instanceof ScalarTypeComposer || type instanceof EnumTypeComposer || type instanceof InterfaceTypeComposer || type instanceof UnionTypeComposer;
|
|
1230
|
+
const validate = (type, value) => {
|
|
1231
|
+
if (type instanceof GraphQLNonNull) {
|
|
1232
|
+
if (value == null) {
|
|
1233
|
+
throw new Error(`Expected non-null field value.`);
|
|
1234
|
+
}
|
|
1235
|
+
return validate(type.ofType, value);
|
|
1236
|
+
} else if (type instanceof GraphQLList) {
|
|
1237
|
+
if (!Array.isArray(value)) {
|
|
1238
|
+
throw new Error(`Expected array field value.`);
|
|
1239
|
+
}
|
|
1240
|
+
return value.map(v => validate(type.ofType, v));
|
|
1241
|
+
} else {
|
|
1242
|
+
return type.parseValue(value);
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
const isNodeInterface = interfaceTypeComposer => interfaceTypeComposer.hasInterface(`Node`);
|
|
1246
|
+
const checkQueryableInterfaces = ({
|
|
1247
|
+
schemaComposer
|
|
1248
|
+
}) => {
|
|
1249
|
+
const queryableInterfaces = new Set();
|
|
1250
|
+
schemaComposer.forEach(type => {
|
|
1251
|
+
if (type instanceof InterfaceTypeComposer && isNodeInterface(type)) {
|
|
1252
|
+
queryableInterfaces.add(type.getTypeName());
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
const incorrectTypes = new Set();
|
|
1256
|
+
schemaComposer.forEach(type => {
|
|
1257
|
+
if (type instanceof ObjectTypeComposer) {
|
|
1258
|
+
const interfaces = type.getInterfaces();
|
|
1259
|
+
if (interfaces.some(iface => queryableInterfaces.has(iface.getTypeName())) && !type.hasInterface(`Node`)) {
|
|
1260
|
+
incorrectTypes.add(type.getTypeName());
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
if (incorrectTypes.size) {
|
|
1265
|
+
report.panic(`Types implementing queryable interfaces must also implement the \`Node\` ` + `interface. Check the type definition of ` + `${Array.from(incorrectTypes).map(t => `\`${t}\``).join(`, `)}.`);
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
const mergeFields = ({
|
|
1269
|
+
typeComposer,
|
|
1270
|
+
fields
|
|
1271
|
+
}) => Object.entries(fields).forEach(([fieldName, fieldConfig]) => {
|
|
1272
|
+
if (typeComposer.hasField(fieldName)) {
|
|
1273
|
+
typeComposer.extendField(fieldName, fieldConfig);
|
|
1274
|
+
} else {
|
|
1275
|
+
typeComposer.setField(fieldName, fieldConfig);
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
const mergeResolveType = ({
|
|
1279
|
+
typeComposer,
|
|
1280
|
+
type
|
|
1281
|
+
}) => {
|
|
1282
|
+
if ((type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType) && type.resolveType) {
|
|
1283
|
+
typeComposer.setResolveType(type.resolveType);
|
|
1284
|
+
}
|
|
1285
|
+
if ((type instanceof InterfaceTypeComposer || type instanceof UnionTypeComposer) && type.getResolveType()) {
|
|
1286
|
+
typeComposer.setResolveType(type.getResolveType());
|
|
1287
|
+
}
|
|
1288
|
+
if (!typeComposer.getResolveType()) {
|
|
1289
|
+
typeComposer.setResolveType(node => {
|
|
1290
|
+
var _node$internal;
|
|
1291
|
+
return node === null || node === void 0 ? void 0 : (_node$internal = node.internal) === null || _node$internal === void 0 ? void 0 : _node$internal.type;
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
};
|
|
1295
|
+
//# sourceMappingURL=schema.js.map
|