Skip to content

Commit

Permalink
Fix unknown fragment errors on save (#1964)
Browse files Browse the repository at this point in the history
* Fix unknown fragment errors on save

* Empty commit

* add changeset

Co-authored-by: Rikki Schulte <rikki.schulte@gmail.com>
  • Loading branch information
patrickszmucer and acao committed Oct 29, 2021
1 parent d3a8828 commit 83c4a00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/fresh-tables-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"graphql-language-service-server": patch
"graphql-language-service": patch
---

Fix unknown fragment errors on save
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class MessageProcessor {
const results = await this._languageService.getDiagnostics(
query,
uri,
this._isRelayCompatMode(query) ? false : true,
this._isRelayCompatMode(query),
);
if (results && results.length > 0) {
diagnostics.push(
Expand Down Expand Up @@ -365,7 +365,11 @@ export class MessageProcessor {
const diagnostics: Diagnostic[] = [];
await Promise.all(
contents.map(async ({ query, range }) => {
const results = await this._languageService.getDiagnostics(query, uri);
const results = await this._languageService.getDiagnostics(
query,
uri,
this._isRelayCompatMode(query),
);
if (results && results.length > 0) {
diagnostics.push(...processDiagnosticsMessage(results, query, range));
}
Expand Down Expand Up @@ -592,6 +596,7 @@ export class MessageProcessor {
const results = await this._languageService.getDiagnostics(
query,
uri,
this._isRelayCompatMode(query),
);
if (results && results.length > 0) {
return processDiagnosticsMessage(results, query, range);
Expand Down

0 comments on commit 83c4a00

Please sign in to comment.