ShopifySharp
ShopifySharp copied to clipboard
code errors in wiki sample code
Walking through GraphQL wiki for the first time (Thank you for all your work!) and find some minor errors I had to fix after grabbing the code.
- This iterates through "nodes" (which matches the GraphQL query)
// Iterate over each product node
foreach (var node in graphResult.Data.Products.Nodes)
But ProductInfo defines it as QueriedProduct
public record ProductsInfo
{
public required ProductsPageInfo PageInfo { get; set; }
public required IReadOnlyList<QueriedProduct> QueriedProduct { get; set; }
}
Changed QueriedProduct to Nodes
var request = new GraphRequest
{
// Same as above
};
var graphResult = await graphService.PostAsync<ListProductsResult>(graphRequest);
defining "request" in line 1. passing graphRequest in line 2