@@ -72,7 +72,7 @@ class CurrentShop
72
72
def call ( with_locales : false )
73
73
query = prepare_query ( QUERY , with_locales : with_locales )
74
74
response = execute ( query )
75
- parse_data ( response . data , with_locales : with_locales )
75
+ parse_data ( response , with_locales : with_locales )
76
76
end
77
77
78
78
private
@@ -101,10 +101,11 @@ def prepare_query(query, with_locales:)
101
101
query
102
102
end
103
103
104
- def parse_data ( data , with_locales : false )
104
+ def parse_data ( response , with_locales : false )
105
+ data = response . data
105
106
plan_display_name = ShopifyGraphql . normalize_plan_display_name ( data . shop . plan . displayName )
106
107
plan_name = ShopifyGraphql ::DISPLAY_NAME_TO_PLAN [ plan_display_name ]
107
- response = OpenStruct . new (
108
+ shop_data = OpenStruct . new (
108
109
id : data . shop . id . split ( "/" ) . last . to_i ,
109
110
name : data . shop . name ,
110
111
email : data . shop . email ,
@@ -145,13 +146,14 @@ def parse_data(data, with_locales: false)
145
146
marketing_sms_consent_enabled_at_checkout : data . shop . marketingSmsConsentEnabledAtCheckout ,
146
147
max_product_options : data . shop . resourceLimits . maxProductOptions ,
147
148
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
149
151
)
150
152
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 )
153
155
end
154
- response
156
+ shop_data
155
157
end
156
158
end
157
159
end
0 commit comments