@@ -131,7 +131,10 @@ export const typeDefs = /* GraphQL */ `
131131 pricePreviews: PricePreviews! @auth
132132 corePricePreviews: PricePreviews! @auth
133133 pricingMetadata(type: PricingType): [ProductPricingMetadata!]! @auth
134- pricingPreview(type: PricingType): [ProductPricingPreview!]! @auth
134+ pricingPreview(
135+ type: PricingType
136+ locale: String
137+ ): [ProductPricingPreview!]! @auth
135138 }
136139
137140 ${ toGQLEnum ( PricingType , 'PricingType' ) }
@@ -275,6 +278,7 @@ export interface GQLCustomData {
275278
276279interface PaddlePricingPreviewArgs {
277280 type ?: PricingType ;
281+ locale ?: string ;
278282}
279283
280284export const resolvers : IResolvers < unknown , AuthContext > = traceResolvers <
@@ -389,7 +393,7 @@ export const resolvers: IResolvers<unknown, AuthContext> = traceResolvers<
389393 ) : Promise < BasePricingMetadata [ ] > => getPricingMetadata ( ctx , type ) ,
390394 pricingPreview : async (
391395 _ ,
392- { type = PricingType . Plus } : PaddlePricingPreviewArgs ,
396+ { type = PricingType . Plus , locale } : PaddlePricingPreviewArgs ,
393397 ctx ,
394398 ) : Promise < BasePricingPreview [ ] > => {
395399 const metadata = await getPricingMetadata ( ctx , type ) ;
@@ -416,7 +420,7 @@ export const resolvers: IResolvers<unknown, AuthContext> = traceResolvers<
416420 return {
417421 metadata : meta ,
418422 priceId : item . price . id ,
419- price : getProductPrice ( item ) ,
423+ price : getProductPrice ( item , locale ) ,
420424 currency : {
421425 code : preview . currencyCode ,
422426 symbol : removeNumbers ( item . formattedTotals . total ) ,
0 commit comments