diff --git a/.changeset/fuzzy-ants-float.md b/.changeset/fuzzy-ants-float.md new file mode 100644 index 00000000000..c18b23655ce --- /dev/null +++ b/.changeset/fuzzy-ants-float.md @@ -0,0 +1,5 @@ +--- +'monaco-graphql': patch +--- + +Fix a bug where \_cacheSchemas() was not being called by the language service diff --git a/packages/monaco-graphql/src/LanguageService.ts b/packages/monaco-graphql/src/LanguageService.ts index c80d541b4c9..7e4257ce6df 100644 --- a/packages/monaco-graphql/src/LanguageService.ts +++ b/packages/monaco-graphql/src/LanguageService.ts @@ -64,10 +64,11 @@ export class LanguageService { this._schemaLoader = defaultSchemaLoader; if (schemas) { this._schemas = schemas; + this._cacheSchemas(); } if (parser) { this._parser = parser; - this._cacheSchemas(); + } if (parseOptions) { @@ -86,6 +87,7 @@ export class LanguageService { } private _cacheSchemas() { + console.log('cache schemas') this._schemas.forEach(schema => this._cacheSchema(schema)); }