Liquid console
Mechanic's Liquid console is available in the footer of every page of the Mechanic Shopify app. It's a useful scratchpad for testing Mechanic Liquid, without having to think about the output restrictions of task previews. The console includes information about the final rendering context for each Liquid submission, which can be useful in understanding how Mechanic Liquid works.
The Liquid console has much tighter restrictions than actual task runs. If you run into a memory limit error, or an error relating to the number of Shopify Admin API requests made, try testing your code in a new task subscribing to mechanic/user/trigger. This will allow you to experiment with your code in Mechanic's full runtime environment.

Context
Liquid code is always rendered in a certain context, which includes some information going in, and which may contain additional information afterward.
Mechanic's Liquid console includes information about the final rendering context, as inspected after the render. This includes...
Environment variables, as set by the Mechanic platform ahead of time
Scope variables, as set by the user in their submitted Liquid code during rendering
Information about the way the user's Liquid code interacted with the Shopify API during rendering

Events

Because of this, the Liquid console can be used for examining what a task had access to at the moment of any given event. For a shopify/orders/create event, for example, one might use {% log order.line_items[0] %}
to see the contents of an order's first line item.
Last updated
Was this helpful?