Skip to content

Commit bd01167

Browse files
committed
fix(config): support npm modules for customFetch
1 parent d7a8ca2 commit bd01167

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.changeset/thick-shoes-admire.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-mesh/config': patch
3+
---
4+
5+
Handle customFetch paths correctly

packages/config/src/utils.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ export async function resolveCustomFetch({
134134
additionalPrefixes: additionalPackagePrefixes,
135135
});
136136

137-
const processedModuleName = path.isAbsolute(moduleName)
138-
? moduleName
139-
: path.join('..', moduleName);
137+
const processedModuleName = moduleName.startsWith('.') ? path.join('..', moduleName) : moduleName;
140138
importCode += `import fetchFn from ${JSON.stringify(processedModuleName)};\n`;
141139

142140
return {

0 commit comments

Comments
 (0)