Skip to content

Commit

Permalink
fix: remove schema cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Jun 25, 2024
1 parent b52c391 commit c6461de
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions packages/graphql-language-service-server/src/MessageProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ export class MessageProcessor {
await this._invalidateCache({ uri, version }, uri, contents);
await this._updateFragmentDefinition(uri, contents);
await this._updateObjectTypeDefinition(uri, contents, project);
await this._updateSchemaIfChanged(project, uri);
return { contents, version };
} catch {
return { contents: [], version: 0 };
Expand Down Expand Up @@ -1301,27 +1300,6 @@ export class MessageProcessor {
}
}

private async _updateSchemaIfChanged(
project: GraphQLProjectConfig,
uri: Uri,
): Promise<void> {
await Promise.all(
unwrapProjectSchema(project).map(async schema => {
const schemaFilePath = path.resolve(project.dirpath, schema);
const uriFilePath = URI.parse(uri).fsPath;
if (uriFilePath === schemaFilePath) {
try {
const file = await readFile(schemaFilePath, 'utf-8');
// only invalidate the schema cache if we can actually parse the file
// otherwise, leave the last valid one in place
parse(file, { noLocation: true });
this._graphQLCache.invalidateSchemaCacheForProject(project);
} catch {}
}
}),
);
}

private async _updateObjectTypeDefinition(
uri: Uri,
contents: CachedContent[],
Expand Down

0 comments on commit c6461de

Please sign in to comment.