Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.2 KB

README.md

File metadata and controls

31 lines (24 loc) · 1.2 KB

Build status

GraphQl.Extensions

Extensions for GraphQl library

Get it on NuGet:

PM> Install-Package GraphQl.Extensions

Available extensions:

  • TryExportToDataTable - allows converting result of ExecutionResult class to DataTable.

Available OutputFormatters:

  • GraphQlXlsxFormatter - generates xlsx output from generated GraphQlResult (only for flat data structure)
  • GraphQlCsvFormatter - generates csv output from generated GraphQlResult (only for flat data structure)

Usage

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"));

                })

Samples are available here:

https://github.com/garfieldos/GraphQl.Extensions/tree/master/src/samples/GraphQl.Extensions.Samples.AspNetCore