Shopify / ui-extensions

MIT License
249 stars 35 forks source link

Added examples for product search docs #1965

Closed js-goupil closed 1 month ago

js-goupil commented 1 month ago

Resolves https://github.com/Shopify/pos-next-react-native/issues/36281

Background

This adds fully functional code examples for most functions in the product search api.

Solution

I left out the example for fetchProductVariantsWithProductId, because we are recommending that devs use the paginated version of that function which has an example. However, in my testing process I discovered that this function is also broken, we'll need to look into why it's not working.

🎩

Spin link: https://shopify-dev.ui-extensions-7t4u.jeansebastien-goupil.us.spin.dev/docs/api/pos-ui-extensions/unstable/apis/productsearch-api#example-fetch-multiple-product-variants-by-specifying-variant-ids

I tophatted every example in the documentation by copy pasting the code snippets into an extension that I was running on my physical device. Did a run through on the React ones and then a run through on the TS ones.

Checklist

NathanJolly commented 1 month ago

image Lint errors are related to the generated file that should be deleted by the script update. You can just manually remove the file for now.