Microsoft Dev Blogs

How use a Blazor QuickGrid with GraphQL

thumbnail

Table of Contents

  1. Adding a GraphQL query to Blazor
  2. Adding the QuickGrid component
  3. Conclusion

  1. Adding a GraphQL query to Blazor

    • Use StrawberryShake to generate a client based on the schema.
    • Create a dotnet-tools manifest, add the GraphQL tool, and download the GraphQL schema.
    • Generate the client code specifying the client name "StartrekClient".
    • List all the actors from the StarTrek series.
  2. Adding the QuickGrid component

    • QuickGrid is a Razor component that provides a data grid for common grid rendering scenarios.
    • Bind the QuickGrid property to the GraphQL query using the generated client by StrawberryShake.
    • Use pagination feature of QuickGrid if data source uses tokens like cursor.
    • Use Stl.Executables for virtualization with QuickGrid component.
  3. Conclusion

    • Demonstrated how to bind a Blazor QuickGrid component to a GraphQL query using Strawberry Shake.
    • Encouraged feedback from readers on what they would like to see next about the QuickGrid component.