Skip to content

Commit

Permalink
fix: handle multiple tsconfig extends for resolving GraphQLSP plugi…
Browse files Browse the repository at this point in the history
…n entry (#386)
  • Loading branch information
aweber1 authored Aug 30, 2024
1 parent fa7d569 commit 7fb938d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-seahorses-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gql.tada/internal': patch
---

Update the tsconfig resolver to better handle an array of "extends" values in tsconfig.json files when trying to locate the GraphQLSP plugin entry. Before, if you were using an array for "extends", e.g. `"extends: ["./file1.json", "./file2.json"]`, the first file loaded that did not have a GraphQLSP plugin entry defined would throw an error and prevent subsequent files from being loaded and evaluated. The implemented change now allows for the resolver to continue iterating over `extends` values trying to locate a GraphQLSP plugin entry.
4 changes: 2 additions & 2 deletions packages/internal/src/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ export const loadConfig = async (targetPath?: string): Promise<LoadConfigResult>
if (path.extname(extend) !== '.json') extend += '.json';
try {
const tsconfigPath = await resolveExtend(extend, path.dirname(rootTsconfigPath));
if (tsconfigPath) return load(tsconfigPath);
if (tsconfigPath) return await load(tsconfigPath);
} catch (_error) {}
}
} else if (tsconfig.extends) {
try {
const tsconfigPath = await resolveExtend(tsconfig.extends, path.dirname(rootTsconfigPath));
if (tsconfigPath) return load(tsconfigPath);
if (tsconfigPath) return await load(tsconfigPath);
} catch (_error) {}
}

Expand Down

0 comments on commit 7fb938d

Please sign in to comment.