static async Task ExecuteGraphQLOption(string graphQLOption) { switch (graphQLOption) { case "1": try { var model = await GraphQLExampleCalls.GraphQLQueryAsync(); Console.WriteLine(model); } catch (ArgumentException aex) { Console.WriteLine($"Caught ArgumentException: {aex.Message}"); } break; case "2": try { var model = await GraphQLExampleCalls.GraphQLMutationAsync(); Console.WriteLine(model); } catch (ArgumentException aex) { Console.WriteLine($"Caught ArgumentException: {aex.Message}"); } break; } }
static async Task PrintGraphqlCall() { switch (Console.ReadLine()) { case "1": try { var model = await GraphQLExampleCalls.GraphqlAsync(); Console.WriteLine(model); } catch (ArgumentException aex) { Console.WriteLine($"Caught ArgumentException: {aex.Message}"); } break; case "2": try { var model = await GraphQLExampleCalls.GraphqlMutationAsync(); Console.WriteLine(model); } catch (ArgumentException aex) { Console.WriteLine($"Caught ArgumentException: {aex.Message}"); } break; default: await CallMenu(); break; } }