ShopifySharp icon indicating copy to clipboard operation
ShopifySharp copied to clipboard

New product model - deprecated REST endpoints

Open tig66208 opened this issue 1 year ago • 9 comments

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."

tig66208 avatar Feb 01 '24 22:02 tig66208

GraphQL has been supported for a while via the GraphService.

clement911 avatar Feb 01 '24 22:02 clement911

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 avatar Feb 01 '24 22:02 tig66208

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?

tig66208 avatar Feb 01 '24 22:02 tig66208

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

clement911 avatar Feb 01 '24 22:02 clement911

@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.

nozzlegear avatar Feb 01 '24 22:02 nozzlegear

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

So, just to confirm:

  • graphql queries we still need to pass as a string, we don't have a type system for building those -return types are pretty well covered

tig66208 avatar Feb 01 '24 22:02 tig66208

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

clement911 avatar Feb 01 '24 22:02 clement911

Thank you BOTH.

tig66208 avatar Feb 01 '24 22:02 tig66208