Skip to content

Commit 7dfaef7

Browse files
authored
improvement: server only LSP bugfix for config extensions (#1637)
1 parent d989456 commit 7dfaef7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/graphql-language-service-interface/src/GraphQLLanguageService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,11 @@ export class GraphQLLanguageService {
194194

195195
// Check if there are custom validation rules to be used
196196
let customRules: ValidationRule[] | null = null;
197-
const customValidationRules = extensions.customValidationRules;
198-
if (customValidationRules) {
199-
customRules = customValidationRules(this._graphQLConfig);
197+
if (
198+
extensions?.customValidationRules &&
199+
typeof extensions.customValidationRules === 'function'
200+
) {
201+
customRules = extensions.customValidationRules(this._graphQLConfig);
200202

201203
/* eslint-enable no-implicit-coercion */
202204
}

0 commit comments

Comments
 (0)