Last active
August 26, 2021 10:57
-
-
Save PascalSenn/637bad56d0236556bf0c396eba7f425c to your computer and use it in GitHub Desktop.
Print Schema with Args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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