Skip to content

Releases: nozzlegear/ShopifySharp

ShopifySharp 6.25.4

27 Sep 04:20

Choose a tag to compare

Release notes

ShopifySharp v6.25.4 is now available on Nuget! This is another small but important bug fix release which addresses a json serialization/deserialization bug that affects the pre-generated GraphQL union case types.

Fixes

  • Fixed GraphQL union case serialization/deserialization returning null values. (#1219)

Changes

  • Made the As{UnionCaseType} extension methods available to .NET Standard 2.0 and .NET Framework. (#1219)

Full Changelog: ShopifySharp/6.25.3...ShopifySharp/6.25.4

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.25.3

12 Sep 06:02

Choose a tag to compare

This release of ShopifySharp now correctly targets version 2025-07 of Shopify's API. Previous iterations of 6.25.x were erroneously targeting API version 2024-10 despite the GraphQL types being regenerated using the newer version of Shopify's API.

Thanks to @AllainPL for catching this error!

Release notes

  • Set Shopify API version target to 2025-07 (#1216)

Full Changelog: ShopifySharp/6.25.2...ShopifySharp/6.25.3

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.25.2

11 Sep 06:33

Choose a tag to compare

ShopifySharp 6.25.2 is now available on Nuget! This release contains another bug fix for union case polymorphic serialization in ShopifySharp's generated GraphQL types. It also includes a fix for the Collect.Position property, and a brand new LineItem.CurrentQuantity property.

Release notes

Full Changelog: ShopifySharp/6.25.1...ShopifySharp/6.25.2

🎉 New Contributors

Thank you for contributing!

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.25.1

01 Sep 00:17

Choose a tag to compare

ShopifySharp 6.25.1 is now available on Nuget! This release contains important bugfixes for anyone using the pregenerated GraphQL types included with ShopifySharp with their GraphQL queries.

Bugfixes

  • Fixed an issue that caused the deserialization of any of ShopifySharp's pregenerated GraphQL interface and union types to throw a System.NotSupportedException exception. (#1205, #1208, #1209)
  • Fixed an issue preventing deserialization of the PageInfo and Edge types.

New exception types

  • Added ShopifyUnsupportedTypeDeserializationException extending ShopifyJsonParseException. This exception is thrown when one or more of the types being deserialized by ShopifySharp are abstract or interface types with no polymorphic configuration attributes. (#1207)
  • Added ShopifyUnspecifiedTypeDiscriminatorException extending ShopifyJsonParseException. This exception will be thrown when a GraphQL query is trying to deserialize an interface, union type or custom polymorphic type but the __typename discriminator field was not included in the query. (#1207)

Full Changelog: ShopifySharp/6.25.0...31fc1bb

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp.Extensions.DependencyInjection 1.9.0

31 Aug 22:48

Choose a tag to compare

Release notes

  • Added the ShopifySharp.Utilities.GraphqlUtility to the services included by serviceCollection.AddShopifySharpUtilities() and services.AddShopifySharp().

Full Changelog: 9cae008...ShopifySharp.Extensions.DependencyInjection/1.9.0

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.25.0

21 Aug 22:41
25a7d77

Choose a tag to compare

🎺 Shopify API Version 2025-07

Hear ye, hear ye, ShopifySharp has been updated to support version 2025-07 of Shopify's API. This release is nothing super exciting, unless you're very passionate about new GraphQL models, in which case boy do I have news for you!

Updated GraphQL schema for your IDE plugins

If you're using a GraphQL plugin to get intellisense and autocomplete in your IDE when writing graph queries with ShopifySharp, don't forget to update your schema file. You can grab the latest version of Shopify's GraphQL schema right here. If you haven't configured a plugin yet (it's not required, but it's nice to have), you can follow the instructions over on ShopifySharp's wiki to get started. (Visual Studio users let me know wtf has to be done to get this working because it's a mystery.)

A new ShopifyGraphqlUtility class has been introduced in this release with a GetSchemaAsJsonStringAsync method, which can be used to download any arbitrary API version's GraphQL schema as a json string. Use this utility class to automate your schema plugins, if you desire.

GraphQL models regenerated with support for mutation input types

A new API version means out with the old GraphQL models and in with the new. All GraphQL models have been regenerated based on version 2025-07 of Shopify's API, which means you may have some breaking changes depending on which generated types you used in the ShopifySharp.GraphQL namespace and what changes Shopify made to them in the interim between 2025-10 and 2025-07.

One of the biggest changes in this area, compared to previous releases, is that our generated types now also include mutation input types. That means you don't have to create your own ProductCreateInput class when you want to run the productCreate mutation, for example – just use the one provided by ShopifySharp:

var productInput = new ShopifySharp.GraphQL.ProductCreateInput
{
  title = "My Product"
};
var graphRequest = new GraphRequest
{
  Query = 
  """
  mutation createProduct($productInput: ProductCreateInput) {
    productCreate(product: $productInput) {
      userErrors {
        message
        field
      }
      product {
        id
      }
    }
  }
  """,
  Variables = new Dictionary<string, object>
  {
    {"productInput", productCreateInput}
  },
}

Note

Remember, it's also possible to use your own custom types with ShopifySharp instead of using the ones generated based on their schema! Head over to the ShopifySharp wiki to learn more.

.NET Framework support

The mountains were young when users first began asking for ShopifySharp to make the generated GraphQL models in the ShopifySharp.GraphQL namespace available to .NET Framework. After a not-insignificant amount of work on implementing a graphql-to-csharp model generator specifically tuned for ShopifySharp and its idiosyncrasies, I'm happy to report that it's now possible to use ShopifySharp's generated models if you're a .NET Framework developer!

New model generator, report bugs!

This release is the first to use a custom, ShopifySharp-specific GraphQL model generator. I've tried my best to keep the models generated by this generator as close as possible to the output of our previous model generator, Wish's GraphQLSharp by ShopifySharp contributor @clement911. However, if you run into any bugs or breaking changes that aren't just the upstream Shopify graph types themselves changing, please report it!

What changed

  • Refactor GraphQL model generator by @nozzlegear (#1190)
  • Regenerate GraphQL models for API version 2025-07 (#1204)
  • Enabled .NET Framework support for generated GraphQL models in the ShopifySharp.GraphQL namespace (#1167, #1143)
  • Added a new ShopifyGraphqlUtility class with a GetSchemaAsJsonStringAsync method which can be used to download a specific API version's GraphQL schema as json

Full Changelog: ShopifySharp/6.24.1...ShopifySharp/6.25.0

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.24.0

13 May 16:07

Choose a tag to compare

Removal of deprecated GraphRequest properties

This release of ShopifySharp removes two properties on the GraphRequest class that were deprecated back in early January:

Removed Replacement Old type New type
GraphRequest.query GraphRequest.Query string string
GraphRequest.variables GraphRequest.Variables object Dictionary<string, object>

Migrating to the new properties is pretty simple, you'll just need to refactor the variables from an anonymous object type to a dictionary:

// Old, wack:
var graphRequest = new GraphRequest
{
  query = "...",
  variables = new { foo = "bar", baz = 5 }
};

// New, dope:
var graphRequest = new GraphRequest
{
  Query = "...",
  Variables = new Dictionary<string, object>
  {
    {  "foo", "bar" },
    { "baz", 5 }
  }
};

Thanks to @mikejamescalvert for the pull request!

New Contributors

Full Changelog: ShopifySharp/6.23.0...ShopifySharp/6.24.0

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.23.0

28 Apr 01:51

Choose a tag to compare

Improved support for Online (per-user) access tokens

This release of ShopifySharp improves support for Shopify's "Online" access tokens (alternately referred to as "per-user" access tokens in Shopify's documentation) by adding a new AuthorizationAccessMode enum for use with the ShopifyOauthUtility.BuildAuthorizationUrl method. In addition, a new OnlineAccess property has been added to the AuthorizationResult type, which will be populated by Shopify if you send the user through Shopify's OAuth login flow using the AuthorizationAccessMode.Online mode.

When you use the Online access mode, the access token granted will be scoped to the permissions of the shop user. That means if you're using a mix of Offline access tokens and Online access tokens for the same shop, the Online access token may not have the same permissions as the one granted by the Offline access token. Additionally, the Online access token will expire after 24 hours (timespan subject to change at the mercy of almighty Shopify).

User Shop role Access mode Permissions granted
John Owner Online ["read-orders", "write-orders"]
Alice Staff Online ["read-orders", "write-orders"]
Bob Staff Online ["read-orders"]
Jane Collaborator Online []
Offline ["read-orders", "write-orders"]

Here's a quick example showcasing the new Online access mode support:

```cs
var shopifyOauthUtility = new ShopifyOauthUtility();

// Step 1: Send the user to Shopify's OAuth page using the Online access mode
var redirectUri = shopifyOauthUtility.BuildAuthorizationUrl(new AuthorizationUrlOptions
{
    Scopes = ["read-orders"],
    ClientId = "your-shopify-client-id",
    State = "some-random-state-token",
    ShopDomain = "example.myshopify.com",
    AuthorizationAccessMode = AuthorizationAccessMode.Online,
    RedirectUrl = "yourapp.example.com/oauth/callback"
});
// ...

// Step 2: Exchange the temporary code for an access token like usual, but this time the `AuthorizationResult` 
// will have a populated `OnlineAccess` object that's contextualized to the shop user.
var authorizationResult = await shopifyOauthUtility.AuthorizeAsync(new AuthorizeOptions
{
    Code = Request.QueryString["code"],
    ShopDomain = "example.myshopify.com",
    ClientId = "your-shopify-client-id",
    ClientSecret = "your-shopify-client-secret",
});

if (authorizationResult.IsOnlineAccess)
{
  Console.WriteLine("OnlineAccess expires in: {0}", authorizationResult.OnlineAccess.ExpiresIn);
  // The shop user may not have the same scopes as the shop owner!
  Console.WriteLine("Shop user has these scopes: {0}", authorizationResult.OnlineAccess.AssociatedUserScopes);
  
  // Additional information about the shop user can be found in authorizationresult.OnlineAccess.AssociatedUser
  DoSomethingWithAssociatedUser(authorizationResult.OnlineAccess.AssociatedUser);
}

Other changes

Two other changes have been included in this release:

  1. Coinciding with support for the new AuthorizationAccessMode enum, the two IShopifyOauthUtility.BuildAuthorizationUrl methods that took IEnumerable<string> grants parameters have been deprecated in favor of IShopifyOauthUtility.BuildAuthorizationurl(AuthorizationUrlOptions).
  • The goal here is to improve future maintainability and backwards compatibility, as it's easier to add/remove/deprecate properties from a record than it is to modify the parameters of a method without introducing breaking changes.
  1. Added IJsonElement.ValueEquals(xyz) and IJsonElement.ValueIsNullOrWhiteSpaceString methods.

Full Changelog: ShopifySharp/6.22.2...ShopifySharp/6.23.0

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.22.2

01 Mar 06:06

Choose a tag to compare

🐛 Fixin' bugs 💥

ShopifySharp v6.22.2 is now available on Nuget! This release contains bugfixes for several annoying System.Text.Json deserialization bugs that would rear their ugly heads when ShopifySharp deserialized certain response values using the GraphService. Here's the full list of fixes in this release:

  • It was discovered that Shopify uses two different json structures for GraphErrorExtensions.Value, and a bug has been fixed where the second, previously unknown structure would cause the GraphService to throw a ShopifyJsonParseException. #1149
  • Fixed an issue where any non-string value in the GraphError.Path value would cause the GraphService to throw a ShopifyJsonParseException. #1152
  • Fixed an issue with the ObjectDictionaryConverter where nested json objects would erroneously be returned as JsonElement values rather than their intended .NET clr types. #1162

Full Changelog: ShopifySharp/6.22.1...ShopifySharp/6.22.2

❤️ How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad – an updated version using GraphQL is coming soon!.

ShopifySharp 6.22.1

28 Jan 06:39

Choose a tag to compare

Summary

This release of ShopifySharp contains a small fix for a bug that caused the GraphService to throw a ShopifyJsonParseException when parsing a json response containing an errors.extensions object that didn't match the expected json structure. Parsing rules for errors and extensions have been relaxed. This bug only affected .NET Framework users.

Full Changelog: ShopifySharp/6.22.0...ShopifySharp/6.22.1

Don't forget to check out the previous release for more info on migrating your Shopify apps to Shopify's GraphQL Product API before February 1st (or April 1st for custom apps), and then head over to ShopifySharp's wiki page for an in-depth guide to using the GraphService!

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd like contribute financially, you can do so by sponsoring the author here on Github, or by purchasing a copy of The Shopify Development Handbook on Gumroad.