Order Status block extension: How to access Order ID and fetch metafields via GraphQL?

Hi everyone,

I’m developing a block extension for the Order Status page (following the guide at Shopify.dev – Build an inline order status UI extension).

I want to display a JSON object that I’ve stored in a metafield on the Shopify Order. My extension cannot access the Order ID and is unable to execute a GraphQL query to fetch the metafield data.

What is the correct way to get the Order ID (or otherwise get access to the correct order context) in a “customer-account.order-status.block” extension target? And how should I structure the GraphQL request (or API access) to fetch the order’s metafield reliably in that environment?

Any pointers or examples would be much appreciated. Thanks!