Skip to content

Commit d5c775a

Browse files
authored
feat(gatsby): handle graphql-import-node bundling (#36951)
1 parent 59e2976 commit d5c775a

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

packages/gatsby/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"got": "^11.8.5",
111111
"graphql": "^16.6.0",
112112
"graphql-compose": "^9.0.9",
113+
"graphql-tag": "^2.12.6",
113114
"hasha": "^5.2.2",
114115
"invariant": "^2.2.4",
115116
"is-relative": "^1.0.0",

packages/gatsby/src/schema/graphql-engine/bundle-webpack.ts

+9
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ export async function createGraphqlEngineBundle(
166166
test: /\.txt/,
167167
type: `asset/resource`,
168168
},
169+
{
170+
test: /\.(graphqls?|gqls?)$/,
171+
use: {
172+
loader: require.resolve(`graphql-tag/loader`),
173+
},
174+
},
169175
],
170176
},
171177
resolve: {
@@ -180,6 +186,9 @@ export async function createGraphqlEngineBundle(
180186
lmdb: require.resolve(`lmdb`),
181187
"ts-node": require.resolve(`./shims/ts-node`),
182188
"gatsby-sharp$": require.resolve(`./shims/gatsby-sharp`),
189+
"graphql-import-node$": require.resolve(`./shims/no-op-module`),
190+
"graphql-import-node/register$":
191+
require.resolve(`./shims/no-op-module`),
183192
},
184193
},
185194
plugins: [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// no-op

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -11918,7 +11918,7 @@ graphql-request@^1.8.2:
1191811918
dependencies:
1191911919
cross-fetch "2.2.2"
1192011920

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

0 commit comments

Comments
 (0)