nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
742 stars 308 forks source link

New product model - deprecated REST endpoints #1008

Open tig66208 opened 7 months ago

tig66208 commented 7 months ago

So...... what's the plan here, folks?

https://shopify.dev/docs/api/admin/migrate/new-product-model/api-updates

Looks like the REST API endpoints for products / variants is being deprecated with no replacement. This is.... less than awesome. I have enough new feature / mission critical things to be built, the last thing I need is having to do maintenance I wasn't planning, so .... thanks Shopify.

I know there has been some discussion about support of GraphQL, but this is going to force the matter some, don't we think?

Edit to add this fun nugget: "Shopify’s API platform is GraphQL-first. Going forward, our approach to managing products programmatically will reflect that. We’ll be fully deprecating our product REST Admin API endpoints and continuing to build on the changes to the product model in the GraphQL Admin API only."

clement911 commented 7 months ago

GraphQL has been supported for a while via the GraphService.

tig66208 commented 7 months ago

Correct, you can execute a graph query but either I'm missing some documentation somewhere or there's not yet types for all of the graphql model?

tig66208 commented 7 months ago

And if I am having a moment where I'm just totally missing a concept.... shame on me, and apologies.

My thoughts are, should there be a branch to replace the underlying implementation of the product service and product variant service for non-breaking changes to clients?

clement911 commented 7 months ago

There types for all graph objects are actually already in the library, but we don't have enough docs about it.

This file shows a couple of example: https://github.com/nozzlegear/ShopifySharp/blob/master/ShopifySharp.Tests/Graph_SendTests.cs

nozzlegear commented 7 months ago

@tig66208 We're starting a 7.0 release very soon, I just need to create all the tracking issues for the more pressing breaking changes that I want to include in the release.

I'll work on getting some thorough docs written up for using the graph service and the GraphQL types that we have built into ShopifySharp already. I agree they're not easy to discover since they're not documented anywhere. I'll change that this weekend, but the link that @clement911 sent to the tests should get you started.

We both use the GraphService in production and it works well, I have some QoL improvements planned for 7.0 as well.

tig66208 commented 7 months ago

Ah, yes.... ok I see it in the Entities/GraphQL/GraphQL.generated now.

So, just to confirm:

clement911 commented 7 months ago

Yes, that is correct. Types are used for the return types. Queries are built with plain strings.

tig66208 commented 7 months ago

Thank you BOTH.