Skip to content

Instantly share code, notes, and snippets.

@PascalSenn
Last active August 26, 2021 10:57
Show Gist options
  • Save PascalSenn/637bad56d0236556bf0c396eba7f425c to your computer and use it in GitHub Desktop.
Save PascalSenn/637bad56d0236556bf0c396eba7f425c to your computer and use it in GitHub Desktop.
Print Schema with Args
public class Program
{
public static async Task Main(string[] args)
{
IHost? host = CreateHostBuilder(args).Build();
if (args.Contains("--generate-schema"))
{
IRequestExecutor executor = await host.Services
.GetRequiredService<IRequestExecutorResolver>()
.GetRequestExecutorAsync();
Console.WriteLine(executor.Schema.Print());
}
else
{
await host.RunAsync();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment