This repository demonstrates how to bind a Syncfusion Blazor DataGrid to a GraphQL data source using the DataManager GraphQL adaptor. The solution consists of two applications: an ASP.NET Core GraphQL server and a Blazor Server application that consumes GraphQL data through the Grid. The sample shows how DataManager communicates with a GraphQL endpoint and enables Grid data operations by sending GraphQL queries and request arguments to the server. This approach allows the Grid to retrieve only the required data while supporting server-side processing through GraphQL.
- Uses a dedicated GraphQL server hosted in the
ASPNetCoreGraphQlServer-EmptyApp/ASPNetCoreGraphQlServerproject. - Uses a Blazor application hosted in the
Blazor Server App/BlazorApplicationproject. - Demonstrates binding Syncfusion Blazor DataGrid data through the DataManager GraphQL adaptor.
- Shows how Grid requests are sent to a GraphQL endpoint instead of a traditional REST service.
- Supports GraphQL-based data operations including paging, sorting, filtering, and CRUD operations as described by the sample implementation.
- Demonstrates communication between the GraphQL server application and the Blazor Grid application.
- Can be tested with the Banana Cake Pop GraphQL IDE or other GraphQL-compatible tools.
- Visual Studio 2022 or Visual Studio Code
- .NET SDK compatible with the project's target framework
Visual Studio 2022
- Clone or download this repository.
- Open the solution in
ASPNetCoreGraphQlServer-EmptyApp/ASPNetCoreGraphQlServer. - Restore all NuGet packages.
- Build and run the GraphQL server application.
- Open the solution in
Blazor Server App/BlazorApplication. - Restore all NuGet packages.
- Set
BlazorApplicationas the startup project if required. - Build the solution.
- Run the application using
Ctrl+F5.
Visual Studio Code
- Open the repository folder in Visual Studio Code.
- Open the integrated terminal.
- Navigate to the GraphQL server project directory and run the server.
cd "ASPNetCoreGraphQlServer-EmptyApp/ASPNetCoreGraphQlServer"
dotnet restore
dotnet run- Open another terminal and navigate to the Blazor application directory.
cd "Blazor Server App/BlazorApplication"
dotnet restore
dotnet run- Open the application URL shown in the console after startup.
- Verify that the GraphQL server is running before loading the Blazor application.
Blazor Server App/BlazorApplication/Pages/— contains the page that binds Grid data using the DataManager GraphQL adaptor.ASPNetCoreGraphQlServer-EmptyApp/ASPNetCoreGraphQlServer/— contains GraphQL schema, resolvers, and server-side processing logic.
- For general product questions, visit the Syncfusion Community Forum or Syncfusion Support.
- To report an issue specific to this sample, open a GitHub issue in this repository.
- For official documentation related to this feature, see https://help.syncfusion.com/grid-sdk/blazor/data-grid/connecting-to-adaptors/graphql-adaptor
This is a Syncfusion sample project provided to demonstrate product usage. Review the Syncfusion license terms before using Syncfusion components in your own applications.