Use PurchasingEntity, DiscountApplications and other dynamic type fields in Shopify Flow

Published

This summary was written by ShopDigest AI from Shopify Changelog’s report. Read the full story ↗

Union fields are those where a single variable has more than one possible type. There are many examples in the Shopify GraphQL API. For example, pu…

Overview

Shopify Flow now supports dynamic type fields from the GraphQL API, such as PurchasingEntity and DiscountApplications. This allows merchants to build workflows that check the specific type of a field, like whether a discount was applied by a Script or which company placed an order. The update emphasizes the need to verify the type using the typename field before acting on the data.

Key Details

  • Union fields like purchasingEntity can be either a PurchasingCompany or a Customer.
  • Interface fields like DiscountApplications share a common value object.
  • Use the typename field to check the actual type in conditions.
  • Enables new workflows, such as detecting Scripts discounts or identifying the ordering company.

About this story

Published
10 May 2023
Originally published at