Skip to content

Commit

Permalink
fix monaco-graphql bug with cacheSchemas()
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Dec 8, 2021
1 parent 7d634f8 commit dd8df38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-ants-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'monaco-graphql': patch
---

Fix a bug where \_cacheSchemas() was not being called by the language service
4 changes: 3 additions & 1 deletion packages/monaco-graphql/src/LanguageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -86,6 +87,7 @@ export class LanguageService {
}

private _cacheSchemas() {
console.log('cache schemas')
this._schemas.forEach(schema => this._cacheSchema(schema));
}

Expand Down

0 comments on commit dd8df38

Please sign in to comment.