How to store and display product on an embedded app ?

Highlighted
Tourist
15 0 1

Hi,

In my React embedded app, I use the RessourcePicker from @shopify/app-bridge to let the user select a product.

That gives me an ID like: gid://shopify/Product/1324932956216 and I store it in my backend database (I need to access it later).

My problem is when the user refresh the UI, the product ID comes from my database, and I'm wondering how I can display product info (title, price, ...) in my frontend ? 

 

Thanks

0 Likes
Shopify Staff
Shopify Staff
50 10 16

Hi boolangery,

 

In order to retrieve the product info, your app would need to call the GraphQL Admin API. See this guide for more info: https://shopify.dev/tutorials/make-your-first-graphql-request.

 

You might also find this useful: https://shopify.dev/tutorials/build-a-shopify-app-with-node-and-react/fetch-data-with-apollo.

0 Likes