How can I create draft order on gadget?

HI, guys, I need help. Nowadays, I am developing gadget project and currently I have one problem and I need solution. So, I have to create draft order on gadget using shopify graphql api. When I click any button, draft order must be created with some data on shopify store. How can I do?
4 Replies
Chocci_Milk
Chocci_Milkβ€’2w ago
Hello, Please take a look at these docs: https://docs.gadget.dev/guides/plugins/shopify/frontends#calling-shopify-within-actions Please note that the rest of the information is available in Shopify's docs
ΰΌΊπŸƒβ˜ž 𝓕π“ͺ𝓢𝓲𝓡𝔂 β˜ͺツ
Thank you. Please let me check. Hi, @Chocci_Milk I tried, and currently connections.shopify.current is undefined. How can I fix this issue? My extension is liquid block.
Chocci_Milk
Chocci_Milkβ€’2w ago
It is against our server rules to ping Gadget employees unless its an emergency or we haven’t responded within 24 hours (during our 9-5 Mon-Fri EST work week) connections.shopify.current won't be set since you aren't making a request from a client with session tokens. The only way to get around this is to create a Shopify app proxy. I recommend reading the code from this template in order to figure out how to do this: https://github.com/gadget-inc/templates/tree/main/shopify/product-reviews-public-remix-ssr I recommend reading the README and looking at the extension code to figure out how it works Then also read these docs for a deeper understanding: https://docs.gadget.dev/guides/plugins/shopify/advanced-topics/extensions#theme-app-extensions These additional docs might help as well: https://docs.gadget.dev/guides/plugins/shopify/advanced-topics/customer-account-ui-extensions#using-preventcrossshopdataaccess
Gizmo
Gizmoβ€’2w ago
Do you like this answer? ​

Did you find this page helpful?