Skip to content

Commit

Permalink
feat(gatsby): handle graphql-import-node bundling (#36951) (#36953)
Browse files Browse the repository at this point in the history
(cherry picked from commit d5c775a)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
  • Loading branch information
ViCo0TeCH and pieh committed Nov 3, 2022
1 parent 5e5d565 commit 1926b4e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/gatsby/package.json
Expand Up @@ -110,6 +110,7 @@
"graphql": "^15.7.2",
"graphql-compose": "^9.0.7",
"graphql-playground-middleware-express": "^1.7.22",
"graphql-tag": "^2.12.6",
"hasha": "^5.2.2",
"invariant": "^2.2.4",
"is-relative": "^1.0.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/gatsby/src/schema/graphql-engine/bundle-webpack.ts
Expand Up @@ -166,6 +166,12 @@ export async function createGraphqlEngineBundle(
test: /\.txt/,
type: `asset/resource`,
},
{
test: /\.(graphqls?|gqls?)$/,
use: {
loader: require.resolve(`graphql-tag/loader`),
},
},
],
},
resolve: {
Expand All @@ -180,6 +186,9 @@ export async function createGraphqlEngineBundle(
lmdb: require.resolve(`lmdb`),
"ts-node": require.resolve(`./shims/ts-node`),
"gatsby-sharp$": require.resolve(`./shims/gatsby-sharp`),
"graphql-import-node$": require.resolve(`./shims/no-op-module`),
"graphql-import-node/register$":
require.resolve(`./shims/no-op-module`),
},
},
plugins: [
Expand Down
@@ -0,0 +1 @@
// no-op
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -11783,7 +11783,7 @@ graphql-request@^1.8.2:
dependencies:
cross-fetch "2.2.2"

graphql-tag@^2.11.0, graphql-tag@^2.12.3:
graphql-tag@^2.11.0, graphql-tag@^2.12.3, graphql-tag@^2.12.6:
version "2.12.6"
resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1"
integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==
Expand Down

0 comments on commit 1926b4e

Please sign in to comment.