diff --git a/.changeset/poor-terms-greet.md b/.changeset/poor-terms-greet.md new file mode 100644 index 0000000000..1b92d890d0 --- /dev/null +++ b/.changeset/poor-terms-greet.md @@ -0,0 +1,5 @@ +--- +'graphql-language-service-server': patch +--- + +Add missing `?.` operator in loading config diff --git a/packages/graphql-language-service-server/src/MessageProcessor.ts b/packages/graphql-language-service-server/src/MessageProcessor.ts index 3c616548ce..87a751d53a 100644 --- a/packages/graphql-language-service-server/src/MessageProcessor.ts +++ b/packages/graphql-language-service-server/src/MessageProcessor.ts @@ -213,7 +213,7 @@ export class MessageProcessor { // TODO: eventually we will instantiate an instance of this per workspace, // so rootDir should become that workspace's rootDir this._settings = { ...settings, ...vscodeSettings }; - const rootDir = this._settings?.load?.rootDir.length + const rootDir = this._settings?.load?.rootDir?.length ? this._settings?.load?.rootDir : this._rootPath; if (settings?.dotEnvPath) {