Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit e827023

Browse files
committed
feat: unified getStorefront api
1 parent 48601d4 commit e827023

8 files changed

Lines changed: 29 additions & 28 deletions

File tree

src/api-android.graphql

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# Android-specific API operations
22

3-
extend type Query {
4-
"""
5-
Get the current Play Store storefront country code
6-
"""
7-
# Future
8-
getStorefrontAndroid: String!
9-
}
10-
113
extend type Mutation {
124
"""
135
Acknowledge a non-consumable purchase or subscription

src/api-ios.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extend type Query {
55
Get the current App Store storefront country code
66
"""
77
# Future
8-
getStorefrontIOS: String!
8+
getStorefrontIOS: String! @deprecated(reason: "Use getStorefront")
99
"""
1010
Get the currently promoted product (iOS 11+)
1111
"""

src/api.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ extend type Query {
2222
"""
2323
# Future
2424
hasActiveSubscriptions(subscriptionIds: [String!]): Boolean!
25+
"""
26+
Get the current storefront country code
27+
"""
28+
# Future
29+
getStorefront: String!
2530
}
2631

2732
# Request APIs (event driven)

src/generated/Types.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,9 +2123,9 @@ public interface QueryResolver {
21232123
*/
21242124
suspend fun getReceiptDataIOS(): String?
21252125
/**
2126-
* Get the current Play Store storefront country code
2126+
* Get the current storefront country code
21272127
*/
2128-
suspend fun getStorefrontAndroid(): String
2128+
suspend fun getStorefront(): String
21292129
/**
21302130
* Get the current App Store storefront country code
21312131
*/
@@ -2226,7 +2226,7 @@ public typealias QueryGetAvailablePurchasesHandler = suspend (options: PurchaseO
22262226
public typealias QueryGetPendingTransactionsIOSHandler = suspend () -> List<PurchaseIOS>
22272227
public typealias QueryGetPromotedProductIOSHandler = suspend () -> ProductIOS?
22282228
public typealias QueryGetReceiptDataIOSHandler = suspend () -> String?
2229-
public typealias QueryGetStorefrontAndroidHandler = suspend () -> String
2229+
public typealias QueryGetStorefrontHandler = suspend () -> String
22302230
public typealias QueryGetStorefrontIOSHandler = suspend () -> String
22312231
public typealias QueryGetTransactionJwsIOSHandler = suspend (sku: String) -> String?
22322232
public typealias QueryHasActiveSubscriptionsHandler = suspend (subscriptionIds: List<String>?) -> Boolean
@@ -2245,7 +2245,7 @@ public data class QueryHandlers(
22452245
val getPendingTransactionsIOS: QueryGetPendingTransactionsIOSHandler? = null,
22462246
val getPromotedProductIOS: QueryGetPromotedProductIOSHandler? = null,
22472247
val getReceiptDataIOS: QueryGetReceiptDataIOSHandler? = null,
2248-
val getStorefrontAndroid: QueryGetStorefrontAndroidHandler? = null,
2248+
val getStorefront: QueryGetStorefrontHandler? = null,
22492249
val getStorefrontIOS: QueryGetStorefrontIOSHandler? = null,
22502250
val getTransactionJwsIOS: QueryGetTransactionJwsIOSHandler? = null,
22512251
val hasActiveSubscriptions: QueryHasActiveSubscriptionsHandler? = null,

src/generated/Types.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ public protocol QueryResolver {
976976
func getPromotedProductIOS() async throws -> ProductIOS?
977977
/// Get base64-encoded receipt data for validation
978978
func getReceiptDataIOS() async throws -> String?
979-
/// Get the current Play Store storefront country code
980-
func getStorefrontAndroid() async throws -> String
979+
/// Get the current storefront country code
980+
func getStorefront() async throws -> String
981981
/// Get the current App Store storefront country code
982982
func getStorefrontIOS() async throws -> String
983983
/// Get the transaction JWS (StoreKit 2)
@@ -1088,7 +1088,7 @@ public typealias QueryGetAvailablePurchasesHandler = (_ options: PurchaseOptions
10881088
public typealias QueryGetPendingTransactionsIOSHandler = () async throws -> [PurchaseIOS]
10891089
public typealias QueryGetPromotedProductIOSHandler = () async throws -> ProductIOS?
10901090
public typealias QueryGetReceiptDataIOSHandler = () async throws -> String?
1091-
public typealias QueryGetStorefrontAndroidHandler = () async throws -> String
1091+
public typealias QueryGetStorefrontHandler = () async throws -> String
10921092
public typealias QueryGetStorefrontIOSHandler = () async throws -> String
10931093
public typealias QueryGetTransactionJwsIOSHandler = (_ sku: String) async throws -> String?
10941094
public typealias QueryHasActiveSubscriptionsHandler = (_ subscriptionIds: [String]?) async throws -> Bool
@@ -1107,7 +1107,7 @@ public struct QueryHandlers {
11071107
public var getPendingTransactionsIOS: QueryGetPendingTransactionsIOSHandler?
11081108
public var getPromotedProductIOS: QueryGetPromotedProductIOSHandler?
11091109
public var getReceiptDataIOS: QueryGetReceiptDataIOSHandler?
1110-
public var getStorefrontAndroid: QueryGetStorefrontAndroidHandler?
1110+
public var getStorefront: QueryGetStorefrontHandler?
11111111
public var getStorefrontIOS: QueryGetStorefrontIOSHandler?
11121112
public var getTransactionJwsIOS: QueryGetTransactionJwsIOSHandler?
11131113
public var hasActiveSubscriptions: QueryHasActiveSubscriptionsHandler?
@@ -1126,7 +1126,7 @@ public struct QueryHandlers {
11261126
getPendingTransactionsIOS: QueryGetPendingTransactionsIOSHandler? = nil,
11271127
getPromotedProductIOS: QueryGetPromotedProductIOSHandler? = nil,
11281128
getReceiptDataIOS: QueryGetReceiptDataIOSHandler? = nil,
1129-
getStorefrontAndroid: QueryGetStorefrontAndroidHandler? = nil,
1129+
getStorefront: QueryGetStorefrontHandler? = nil,
11301130
getStorefrontIOS: QueryGetStorefrontIOSHandler? = nil,
11311131
getTransactionJwsIOS: QueryGetTransactionJwsIOSHandler? = nil,
11321132
hasActiveSubscriptions: QueryHasActiveSubscriptionsHandler? = nil,
@@ -1144,7 +1144,7 @@ public struct QueryHandlers {
11441144
self.getPendingTransactionsIOS = getPendingTransactionsIOS
11451145
self.getPromotedProductIOS = getPromotedProductIOS
11461146
self.getReceiptDataIOS = getReceiptDataIOS
1147-
self.getStorefrontAndroid = getStorefrontAndroid
1147+
self.getStorefront = getStorefront
11481148
self.getStorefrontIOS = getStorefrontIOS
11491149
self.getTransactionJwsIOS = getTransactionJwsIOS
11501150
self.hasActiveSubscriptions = hasActiveSubscriptions

src/generated/types.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,8 +2618,8 @@ abstract class QueryResolver {
26182618
Future<ProductIOS?> getPromotedProductIOS();
26192619
/// Get base64-encoded receipt data for validation
26202620
Future<String?> getReceiptDataIOS();
2621-
/// Get the current Play Store storefront country code
2622-
Future<String> getStorefrontAndroid();
2621+
/// Get the current storefront country code
2622+
Future<String> getStorefront();
26232623
/// Get the current App Store storefront country code
26242624
Future<String> getStorefrontIOS();
26252625
/// Get the transaction JWS (StoreKit 2)
@@ -2717,7 +2717,7 @@ typedef QueryGetAvailablePurchasesHandler = Future<List<Purchase>> Function([Pur
27172717
typedef QueryGetPendingTransactionsIOSHandler = Future<List<PurchaseIOS>> Function();
27182718
typedef QueryGetPromotedProductIOSHandler = Future<ProductIOS?> Function();
27192719
typedef QueryGetReceiptDataIOSHandler = Future<String?> Function();
2720-
typedef QueryGetStorefrontAndroidHandler = Future<String> Function();
2720+
typedef QueryGetStorefrontHandler = Future<String> Function();
27212721
typedef QueryGetStorefrontIOSHandler = Future<String> Function();
27222722
typedef QueryGetTransactionJwsIOSHandler = Future<String?> Function(String sku);
27232723
typedef QueryHasActiveSubscriptionsHandler = Future<bool> Function([List<String>? subscriptionIds]);
@@ -2737,7 +2737,7 @@ class QueryHandlers {
27372737
this.getPendingTransactionsIOS,
27382738
this.getPromotedProductIOS,
27392739
this.getReceiptDataIOS,
2740-
this.getStorefrontAndroid,
2740+
this.getStorefront,
27412741
this.getStorefrontIOS,
27422742
this.getTransactionJwsIOS,
27432743
this.hasActiveSubscriptions,
@@ -2756,7 +2756,7 @@ class QueryHandlers {
27562756
final QueryGetPendingTransactionsIOSHandler? getPendingTransactionsIOS;
27572757
final QueryGetPromotedProductIOSHandler? getPromotedProductIOS;
27582758
final QueryGetReceiptDataIOSHandler? getReceiptDataIOS;
2759-
final QueryGetStorefrontAndroidHandler? getStorefrontAndroid;
2759+
final QueryGetStorefrontHandler? getStorefront;
27602760
final QueryGetStorefrontIOSHandler? getStorefrontIOS;
27612761
final QueryGetTransactionJwsIOSHandler? getTransactionJwsIOS;
27622762
final QueryHasActiveSubscriptionsHandler? hasActiveSubscriptions;

src/generated/types.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,12 @@ export interface Query {
449449
getPromotedProductIOS?: Promise<(ProductIOS | null)>;
450450
/** Get base64-encoded receipt data for validation */
451451
getReceiptDataIOS?: Promise<(string | null)>;
452-
/** Get the current Play Store storefront country code */
453-
getStorefrontAndroid: Promise<string>;
454-
/** Get the current App Store storefront country code */
452+
/** Get the current storefront country code */
453+
getStorefront: Promise<string>;
454+
/**
455+
* Get the current App Store storefront country code
456+
* @deprecated Use getStorefront
457+
*/
455458
getStorefrontIOS: Promise<string>;
456459
/** Get the transaction JWS (StoreKit 2) */
457460
getTransactionJwsIOS?: Promise<(string | null)>;
@@ -682,7 +685,7 @@ export type QueryArgsMap = {
682685
getPendingTransactionsIOS: never;
683686
getPromotedProductIOS: never;
684687
getReceiptDataIOS: never;
685-
getStorefrontAndroid: never;
688+
getStorefront: never;
686689
getStorefrontIOS: never;
687690
getTransactionJwsIOS: QueryGetTransactionJwsIosArgs;
688691
hasActiveSubscriptions: QueryHasActiveSubscriptionsArgs;

src/type-android.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,4 @@ type ReceiptValidationResultAndroid {
179179
termSku: String!
180180
testTransaction: Boolean!
181181
}
182+

0 commit comments

Comments
 (0)