Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
452 stars 199 forks source link

fetch product id from shopify online store #977

Closed RishabhTayal closed 5 years ago

RishabhTayal commented 5 years ago

I am aware of the id property of Product object. However, this id is a GraphQL id which is not the same as the numeric id from the online store.

How can we get the numeric id?

RishabhTayal commented 5 years ago

If it's technically possible, I could create a PR with the implementation.

dbart01 commented 5 years ago

The contents of the GraphQL identifier is opaque and considered an implementation detail. If you have a transform that you wish to apply to the id, it should live in your application layer, not the SDK.

RishabhTayal commented 5 years ago

@dbart01 I understand the GraphQL identifier is opaque and considered an implementation detail. However, I am just trying to find out a way to get the numeric identifier from the Shopify admin. Do you have any proposed solution on how to find it (Other than calling the REST API)?

If you have a transform that you wish to apply to the id, it should live in your application layer, not the SDK.

What kind of transform are you talking about here?

dbart01 commented 5 years ago

While we don't recommend doing this, you can base64 decode the GraphQL ID and extract the numeric identifier. This is one possible transformation that should live in your application layer.

RishabhTayal commented 5 years ago

Got it. Thanks for the info.