Extensions for GraphQl library
PM> Install-Package GraphQl.Extensions
- TryExportToDataTable - allows converting result of ExecutionResult class to DataTable.
- GraphQlXlsxFormatter - generates xlsx output from generated GraphQlResult (only for flat data structure)
- GraphQlCsvFormatter - generates csv output from generated GraphQlResult (only for flat data structure)
To enable output formatters, you need to add to the ConfigureServices method from startup.cs:
services.AddMvc(options =>
{
options.RespectBrowserAcceptHeader = true;
options.OutputFormatters.Add(new GraphQlCsvFormatter("entity_type", ";", Encoding.UTF8));
options.OutputFormatters.Add(new GraphQlXlsxFormatter("entity_type"));
})