Skip to content

Releases: nozzlegear/ShopifySharp

ShopifySharp 6.22.0

21 Jan 23:35
70d0769
Compare
Choose a tag to compare

Summary

This is a big new release for ShopifySharp with lots of changes inside! If you're using the ProductService or Products API, make sure you've started your migration over to Shopify's GraphQL Products API using the GraphService – Shopify has deprecated the REST API for products1 and product-related-things. All public apps are required to migrate to the GraphQL product API by February 1st, 2025, and all custom apps are required to migrate by April 1st, 2025. 2 Read up on this release, grab the latest version of ShopifySharp and then head over to the wiki page where you can find a guide on using ShopifySharp's GraphService to write GraphQL queries and mutations, with examples featuring the product API.

In line with those requirements, this release of ShopifySharp has many changes aimed at improving the GraphQL experience for developers. From standardizing the methods on ShopifySharp's GraphService class to make it less confusing, to adding baked-in graphql syntax highlighting and intellisense with minimal setup, the experience with the GraphService compared to even just one release should be miles ahead.

Rider with GraphQL intellisense

Our goal is to make the experience of writing graph queries in ShopifySharp and C# in general as painless as possible. I have a lot more improvements still planned, so I'd love to hear your feedback on how things feel in this release and how they can still be improved.

What's Changed

Here's a grand overview of everything that's new or changed in ShopifySharp 6.22.0:

  • Fixed a content disposal bug that affected .NET Framework in #1130.
  • Many previous GraphService and IGraphService methods were deprecated, and all methods have now standardized on GraphService.PostAsync(GraphRequest), GraphService.PostAsync<T>(GraphRequest) and GraphService.PostAsync(GraphRequest, Type) in #1051.
  • The GraphService's error handling was updated and standardized to consistently throws ShopifyGraphErrorsException and ShopifyGraphUserErrorsException when errors are parsed from the response from Shopify in #1127.
  • Added an IHttpContentSerializer and GraphContentSerializer in #1122.
    • The intent is to open these up and make them injectable for fine-grained control of how content is serialized before it's sent to Shopify.
  • Added an IJsonSerializer and SystemJsonSerializer in #1123.
    • Related to the previous, the intent here is to open these up as well and make them injectable for fine-grained control of how content is serialized/deserialized/parsed.
    • There will also be a NewtonsoftJsonSerializer.
  • The ProductService, ProductVariantService, ProductImageService, ProductListingService, along with their related interfaces and factories, were all deprecated in #1128.
  • Regenerated the GraphQL entities in the ShopifySharp.GraphQL namespace in #1115.
  • Dependencies were updated in #1121.
  • Added documentation for using the GraphService in #1126.

Full Changelog: ShopifySharp/6.21.0...ShopifySharp/6.22.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.


  1. Shopify has actually deprecated the entire REST API, but they've deprecated the Products API ahead of everything else. We're expected to migrate everything over to the GraphQL API eventually!

  2. Product API migration dates: https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model

ShopifySharp.Extensions.DependencyInjection 1.8.0

21 Jan 23:34
37ca222
Compare
Choose a tag to compare

Summary

ShopifySharp.Extensions.DependencyInjection version 1.8.0 is now available on Nuget! This version primarily contains under-the-hood enhancements for the latest version of ShopifySharp v6.22.0, which itself has massive changes to the GraphService and json serialization.

In addition to those under-the-hood updates for supporting ShopifySharp, this release also paves the way for an update I'm working on to bring even more service injection into ShopifySharp. The plan is to help you inject things like HttpClientFactory, HttpClient, json serializers, and more. Check this board for more details.

What's changed

  • This package now requires ShopifySharp >= v6.22.0 to install.
  • .NET Framework 6.0 was dropped as a target framework.
  • An IServiceProvider is now passed to all ShopifySharp service factories to resolve dependencies. This is now the preferred constructor method for the factories.
  • ShopifySharp's service factories themselves now construct the ShopifySharp service classes using the new (ShopifyApiCredentials credentials) constructor. Previously, they used the new (string shopDomain, string accessToken) constructor.

Full Changelog: 1.7.0...ShopifySharp.Extensions.DependencyInjection/1.8.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.

ShopifySharp 6.18.0

06 Jul 04:40
e1966ae
Compare
Choose a tag to compare

Summary

ShopifySharp v6.18.0 is now available on Nuget! This release updates our target Shopify API version to 2024-07. You can upgrade ShopifySharp using the dotnet CLI – dotnet add package shopifysharp --version 6.18.0 – or with your IDE's package manager UI. Once you upgrade ShopifySharp, don't forget to upgrade your Shopify webhook API version in the Partner dashboard to match.

What's changed

  • All service classes now use API version 2024-07, as noted above.
  • All GraphQL entities in the ShopifySharp.GraphQL namespace have been regenerated based on Shopify's 2024-07 GraphQL schema.
  • Added a new Transaction.AdjustmentReason property.
  • Added new DeliveryMethod.ServiceCode, DeliveryMethod.SourceReference, DeliveryMethod.BrandedPromise and DeliveryMethod.AdditionalInformation properties.
  • Deprecated the CountryService, CountryServiceFactory and related interfaces. Shopify has deprecated the REST API's Country endpoint, and they recommend developers migrate to the Storefront GraphQL API as an alternative.
  • Removed deprecated Order.ProcessingMethod property.
  • Removed deprecated FulfillmentServiceEntity.FulfillmentOrdersOptIn property. Fulfillment Orders are now the only processing method for fulfillment services and fulfilling orders in general, so there is no more concept of "opting in" to fulfillment orders.
  • Removed deprecated ShopifyException http properties. If you used. these properties, you should be able to switch all of your catch (ShopifyException ex) where (ex.StatusCode) to (ShopifyHttpException ex) where (ex.StatusCode).
  • Moved ShopifyHttpException into the ShopifySharp namespace for consistency.
  • Added a default exception message for ShopifyExponentialRetryCanceledException.

These changes should only affect you if you've created your own class that extends one of ShopifySharp's services, or if you've created a custom IRequestExecutionPolicy:

  • Removed deprecated RequestResult.Response property. If you need access to the response status code, you should be able to use RequestResult.StatusCode instead.
  • Removed deprecated ShopifyService.PrepareRequest method. This was replaced with ShopifyService.BuildRequestUri.
  • Removed deprecated ShopifyService.BuildShopUri method. This was replaced with IShopifyDomainUtility.BuildShopDomainUri.
  • Removed deprecated CloneableRequestMessage.Clone method. This was replaced with CloneableRequestMessage.CloneAsync.

Full Changelog: ShopifySharp/6.17.0...ShopifySharp/6.18.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.

ShopifySharp 6.16.1

20 May 03:40
9713ee5
Compare
Choose a tag to compare

Summary

ShopifySharp v6.16.1 is a small release that addresses a potential memory leak bug with undisposed cloneable request messages inside the new ExponentialRetryPolicy. Depending on the way you've configured the policy's options, the policy could eventually run your application out of memory as it held onto each request and woudld never let new ones attack.

What's Changed

  • fix: Dispose cloned request messages in ExponentialRetryPolicy by @nozzlegear in #1069

Full Changelog: ShopifySharp/6.16.0...ShopifySharp/6.16.1

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.

ShopifySharp 6.16.0

19 May 04:05
Compare
Choose a tag to compare

Summary

This release introduces a new request execution policy for ShopifySharp called ExponentialRetryPolicy! As the name suggests, this policy is responsible for making requests to Shopify's API, and then introducing an exponential delay between the last failure and the next time it tries to send the request. The exponential delay is on a per-request basis, so there's no attempt to be "smart" in this policy or to perform any sort of lookup on the access token being used or the leaky bucket status.

You can configure the new policy using the ExponentialRetryPolicyOptions class:

var policyOptions = new ExponentialRetryPolicyOptions
{
  InitialBackoffInMillseconds = 50,
  MaximumDelayBetweenRetries = TimeSpan.FromSeconds(1),
  MaximumTriesBeforeRequestCancellation = null,
  MaximumDelayBeforeRequestCancellation = TimeSpan.FromSeconds(5)
};

Note that MaximumTriesBeforeRequestCancellation and MaximumDelayBeforeRequestCancellation are both nullalbe, but one of them is in fact required and will be validated when the policy is constructed.

Alongside the new policy, this release also adds the RequestResult.StatusCode property, which should make it a simple matter to grab the response's status code in custom IRequestExecutionPolicy "middleware" without relying on the deprecated (and soon to be removed) HttpPRequestMessage object.

Finally, there's a small change that most won't noticed in this pull request unless you've got your own custom IRequestExecutionPolicy. The return result types of RequestResult.GetRestBucketState and RequestResult.GetGraphQLBucketState were changed to be nullable. This does not actually change the underlying implementation – the methods could always return null, the types were simply updated to reflect that fact.

Changelog

Full Changelog: ShopifySharp/6.15.1...ShopifySharp/6.16.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.

ShopifySharp.Extensions.DependencyInjection 1.6.0

Summary

ShopifySharp.Extensions.DependencyInjection 1.6.0 adds support for ShopifySharp's new ExponentialRetryPolicy. Since this is the first policy that requires or supports any kind of configuration, the package has been updated to add defaults for those options to DI when the policy has been added but the options have not. You can override those defaults by supplying your own options:

var policyOptions = new ExponentialRetryPolicyOptions
{
  InitialBackoffInMillseconds = 50,
  MaximumDelayBetweenRetries = TimeSpan.FromSeconds(1),
  MaximumTriesBeforeRequestCancellation = null,
  MaximumDelayBeforeRequestCancellation = TimeSpan.FromSeconds(5)
};

services.AddSingleton(policyOptions);
services.AddShopifySharp<ExponentialRetryPolicy>();

If you don't supply any configuration options, the package will use ExponentialRetryPolicyOptions.Default instead.

Changelog

Full Changelog: ShopifySharp.Extensions.DependencyInjection/1.5.0...ShopifySharp.Extensions.DependencyInjection/1.6.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.

ShopifySharp 6.15.1

10 May 05:58
Compare
Choose a tag to compare

Summary

This release fixes a nasty bug in ShopifySharp's LeakyBucketExecutionPolicy which could cause canceled requests to build up and never be dequeued. If the execution policy was sufficiently swamped (e.g. by a webhook endpoint or just very active usage), then the wait time between requests would increase continuously until each request is waiting potentially 5, 10, 15 minutes between when it enters the queue and when it actually sends. This could lead to OOM exceptions as requests pile up and eventually crash the application, further compounding the problem if this is a webhook endpoint, as Shopify would retry failed requests after 5 seconds.

In addition to that bug fix, this release also adds Product.VariantGids which can be used to map the REST version of a Shopify product to the Graph version. Remember: Shopify has deprecated the REST API for all product and product-related endpoints, which means eventually we'll all need to migrate to the GraphQL API if we want to work with products.

Changelog

Full Changelog: ShopifySharp/6.15.0...ShopifySharp/6.15.1

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.

ShopifySharp 6.15.0

01 May 07:30
af21509
Compare
Choose a tag to compare

Summary

ShopifySharp 6.15.0 has been released and published to Nuget! This release updates our Shopify API version target from 2024-01 to 2024-04. Once you upgrade ShopifySharp, you'll want to make sure you update your Shopify webhook API version in your Partner dashboard to match!

Here's a quick rundown of the things that have changed in this release along with the new API version:

  • Added ShippingLine.IsRemoved
  • Regenerated all ShopifySharp.GraphQL entities to match the 2024-04 graph schema.
  • Marked the CheckoutService and OrderRiskService classes as obsolete. Shopify has deprecated all checkout REST APIs in favor of their storefront cart APIs.
  • The FulfillmentService.FulfillmentOrdersOptIn property has been marked obsolete. This property was deprecated by Shopify, as all fulfillment services have already been opted in to fulfillment orders.

You can download the latest version of ShopifySharp from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp.

Changelog

Full Changelog: ShopifySharp/6.14.1...ShopifySharp/6.15.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.

ShopifySharp 6.14.1

01 May 07:19
Compare
Choose a tag to compare

Summary

ShopifySharp 6.14.1 is a minor release which added two authorization scope enums, in addition to making the ShopifyHttpException.RequestInfo property a nullable string.

You can download the latest version of ShopifySharp from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp.

Changelog

  • ReadReturns and WriteReturns authorization scopes by @arsuceno in #1053
  • Make ShopifyHttpException.RequestInfo a nullable string by @nozzlegear in #1056

Full Changelog: ShopifySharp/6.14.0...ShopifySharp/6.14.1

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.

ShopifySharp.Extensions.DependencyInjection 1.5.0

Summary

This is a new release for ShopifySharp.Extensions.DependencyInjection, bumping the version up to 1.5.0. You can now set the service lifetime when registering ShopifySharp with Microsoft's DI container:

ServiceLifetime serviceLifetime = ServiceLifetime.Scoped;

services.AddShopifySharp<MyRequestExecutionPolicy>(serviceLifetime);

Previously, all services were registered as a singleton and you had no control over the lifetime.

You can download the latest version of ShopifySharp.Extensions.DependencyInjection from Nuget using your IDE, or via the dotnet CLI with dotnet package install shopifysharp.extensions.dependencyinjection.

What's Changed

New Contributors

Full Changelog: ShopifySharp.Extensions.DependencyInjection/1.4.0...ShopifySharp.Extensions.DependencyInjection/1.5.0

How to support ShopifySharp

If you find ShopifySharp useful, please consider contributing to the project! If you'd rather 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.