@@ -72,7 +72,7 @@ class CurrentShop
7272 def call ( with_locales : false )
7373 query = prepare_query ( QUERY , with_locales : with_locales )
7474 response = execute ( query )
75- parse_data ( response . data , with_locales : with_locales )
75+ parse_data ( response , with_locales : with_locales )
7676 end
7777
7878 private
@@ -101,10 +101,11 @@ def prepare_query(query, with_locales:)
101101 query
102102 end
103103
104- def parse_data ( data , with_locales : false )
104+ def parse_data ( response , with_locales : false )
105+ data = response . data
105106 plan_display_name = ShopifyGraphql . normalize_plan_display_name ( data . shop . plan . displayName )
106107 plan_name = ShopifyGraphql ::DISPLAY_NAME_TO_PLAN [ plan_display_name ]
107- response = OpenStruct . new (
108+ shop_data = OpenStruct . new (
108109 id : data . shop . id . split ( "/" ) . last . to_i ,
109110 name : data . shop . name ,
110111 email : data . shop . email ,
@@ -145,13 +146,14 @@ def parse_data(data, with_locales: false)
145146 marketing_sms_consent_enabled_at_checkout : data . shop . marketingSmsConsentEnabledAtCheckout ,
146147 max_product_options : data . shop . resourceLimits . maxProductOptions ,
147148 max_product_variants : data . shop . resourceLimits . maxProductVariants ,
148- unified_markets : !!data . shop &.features &.unifiedMarkets
149+ unified_markets : !!data . shop &.features &.unifiedMarkets ,
150+ graphql_points_limit : response . points_limit
149151 )
150152 if with_locales
151- response . primary_locale = data . shopLocales . find ( &:primary ) . locale
152- response . shop_locales = data . shopLocales . map ( &:locale )
153+ shop_data . primary_locale = data . shopLocales . find ( &:primary ) . locale
154+ shop_data . shop_locales = data . shopLocales . map ( &:locale )
153155 end
154- response
156+ shop_data
155157 end
156158 end
157159end
0 commit comments