Hi, everyone.
I am newbie to shopify platform.
I am building the shopify app with shopify admin graphql and react.
But I have one problem.
When I import the product with some images(those are the external image) to my own store with graphql, I want to resize(width and height) those images and import project with resized images(new url or other).
What is the best way to solve this problem(without other shopify app)?
Please help me asap.
Best regards and thank you.
According to the Shopify GraphQL API documentation you should be able to pass a transformedSrc field set into the image that's created on Shopify's end. See the docs --> https://shopify.dev/docs/admin-api/graphql/reference/common-objects/image#fields-2021-01. Hope this helps!
Thank you @Greg_Kujawa
But when I import the project with images to store with graphql, the valid fields of images are only id, altText, src.(ImageInput)
If this field set isn't available when adding new images via the GQL API you might have to resize them in code before loading into Shopify. Assuming you have access to JavaScript in your environment then there are many ways to accomplish this. Such as --> https://stackoverflow.com/questions/23945494/use-html5-to-resize-an-image-before-upload.
User | Count |
---|---|
13 | |
12 | |
9 | |
7 | |
5 |