We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05270ea commit 7c84758Copy full SHA for 7c84758
Tocsoft.GraphQLCodeGen.Cli/SchemaIntrospection/JsonIntrospection.cs
@@ -12,10 +12,15 @@ public class JsonIntrospection : IIntrosepctionProvider
12
{
13
public SchemaSource.SchemaTypes SchemaType => SchemaSource.SchemaTypes.Json;
14
15
+ static Dictionary<string, string> parseCache = new Dictionary<string, string>();
16
17
public Task<string> LoadSchema(SchemaSource source)
18
- string schema = ConvertJsonToSchema(File.ReadAllText(source.Location));
19
+ if (!parseCache.TryGetValue(source.Location, out var schema))
20
+ {
21
+ schema = ConvertJsonToSchema(File.ReadAllText(source.Location));
22
+ parseCache.Add(source.Location, schema);
23
+ }
24
return Task.FromResult(schema);
25
}
26
0 commit comments