@@ -52,6 +52,7 @@ class CurrentShop
52
52
maxProductOptions
53
53
maxProductVariants
54
54
}
55
+ #FEATURES#
55
56
}
56
57
#LOCALES_SUBQUERY#
57
58
}
@@ -62,6 +63,11 @@ class CurrentShop
62
63
primary
63
64
}
64
65
GRAPHQL
66
+ FEATURES_SUBQUERY = <<~GRAPHQL
67
+ features {
68
+ unifiedMarkets
69
+ }
70
+ GRAPHQL
65
71
66
72
def call ( with_locales : false )
67
73
query = prepare_query ( QUERY , with_locales : with_locales )
@@ -87,6 +93,11 @@ def prepare_query(query, with_locales:)
87
93
query . gsub! ( "#UPDATED_AT#" , "updatedAt" )
88
94
query . gsub! ( "#SMS_CONSENT#" , "marketingSmsConsentEnabledAtCheckout" )
89
95
end
96
+ if ShopifyAPI ::Context . api_version . in? ( %w[ 2024-01 2024-04 2024-07 2024-10 2025-01 ] )
97
+ query . gsub! ( "#FEATURES#" , "" )
98
+ else
99
+ query . gsub! ( "#FEATURES#" , FEATURES_SUBQUERY )
100
+ end
90
101
query
91
102
end
92
103
@@ -133,7 +144,8 @@ def parse_data(data, with_locales: false)
133
144
enabled_presentment_currencies : data . shop . enabledPresentmentCurrencies ,
134
145
marketing_sms_consent_enabled_at_checkout : data . shop . marketingSmsConsentEnabledAtCheckout ,
135
146
max_product_options : data . shop . resourceLimits . maxProductOptions ,
136
- max_product_variants : data . shop . resourceLimits . maxProductVariants
147
+ max_product_variants : data . shop . resourceLimits . maxProductVariants ,
148
+ unified_markets : !!data . shop &.features &.unifiedMarkets
137
149
)
138
150
if with_locales
139
151
response . primary_locale = data . shopLocales . find ( &:primary ) . locale
0 commit comments