Shopify Functions WebAssembly query API

Shopify Functions now support a WebAssembly query API, letting you build smaller, faster, and more powerful functions. Deserialize data just-in-time, and only pay for the fields your function actually uses.


This is a companion discussion topic for the original entry at https://shopify.dev/changelog/functions-webassembly-query-api

Hello,

How does this impact function-runner? Will we have to change the way we pass arguments to function-runner? Does function-runner include the WebAssembly Query API, or will Functions still be parsing JSON themselves within this context?

Our app currently has a feature that uses function-runner to determine how many instructions were executed (so that we can detect and diagnose InstructionCountLimitExceededError). We are planning to update our .wasm executable to use the WebAssembly Query API for input parsing instead of JSON. However, I’m worried that doing this will break the aforementioned feature, if function-runner doesn’t support the Query API.

Please clarify.

Thanks in advance,
Tobe

Hey @tobebuilds

I’ve connected with the Functions team and as long as you are on the latest version of the CLI we detect whether you are using the WebAssembly API with the function runner, you do not need to change the arguments you pass to it.

Thanks for your response. I’ll be sure to look into this further.