public async Task RunAsync() { var schemas = await Task.WhenAll( SchemaConverter.ReadAsync(options.From), SchemaConverter.ReadAsync(options.To) ).ConfigureAwait(false); var from = schemas.First(); var to = schemas.Last(); SchemaConverter.WriteFileAsync("from", from); SchemaConverter.WriteFileAsync("to", to); ShowDiff(from, to); }
public async Task RunAsync() { var config = new GraphQlGeneratorConfiguration() { IncludeDeprecatedFields = options.GenerateDeprecatedTypes, JsonPropertyGeneration = options.JsonPropertyGeneration, CSharpVersion = options.UseNullable ? CSharpVersion.NewestWithNullableReferences : CSharpVersion.Compatible }; var schema = await SchemaConverter.ReadAsync(options.Source).ConfigureAwait(false); var generator = new GraphQlGenerator(config); var content = generator.GenerateFullClientCSharpFile(schema, options.Namespace); Console.WriteLine($"writing client-code to {options.DestinationFile}"); File.WriteAllText(options.DestinationFile, content); }