diff --git a/.changeset/fluffy-seahorses-flow.md b/.changeset/fluffy-seahorses-flow.md new file mode 100644 index 00000000..884dcda9 --- /dev/null +++ b/.changeset/fluffy-seahorses-flow.md @@ -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. diff --git a/packages/internal/src/resolve.ts b/packages/internal/src/resolve.ts index a94cec18..529c2c89 100644 --- a/packages/internal/src/resolve.ts +++ b/packages/internal/src/resolve.ts @@ -102,13 +102,13 @@ export const loadConfig = async (targetPath?: string): Promise 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) {} }