ShopifyNet is a .NET library which enables you to interact with the Shopify GraphQL API with .NET.
To install ShopifyNet, run the following command in your .NET project:
dotnet add package ShopifyNet- Strongly typed queries, mutations, input objects. All API types have been pregenerated and are available in the
ShopifyNet.Typesnamespace. - Support for request interception. This enables centralized logic for logging, retries, rate limit policies, testing, error handling...
- Built-in smart interceptor automatically handles retries and rate limits
- The
ShopifyNet.ShopifyClientis thread safe. - Ability to provide a custom
HttpClientinstance
[TestMethod]
public async Task QuerySimple()
{
var query = """
query {
products(first: 10)
{
nodes
{
id
title
}
}
}
""";
var response = await _client.QueryAsync(query);
//response is strongly typed
Assert.IsNotNull(response.data.products.nodes.FirstOrDefault()?.id);
Assert.IsNull(response.errors);
}See unit tests for more examples.