How to type data from useGlobalAction

I have a global action that fetches an order from the Shopify GraphQL API by id and returns it. It is correctly typed (see attached image). On the frontend, I call this action with useGlobalAction from Gadget, but the data is not typed (see attached image 2).
No description
No description
1 Reply
Chocci_Milk
Chocci_Milk4w ago
Hello, There's currently no way for us to type the return of a global action as it can be indeterminate. That's because global actions aren't tied to something that's typed like a model. You'll need to write and change the types yourself based on what you return from the action

Did you find this page helpful?