Skip to content

Commit 02bfea7

Browse files
authored
Merge pull request #6478 from Shopify/10-03-fix_error_when_the_store_doesn_t_have_a_url
Fix error when the store doesn't have a URL
2 parents ab3ea53 + 5b17837 commit 02bfea7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

packages/app/src/cli/api/graphql/business-platform-organizations/generated/fetch_dev_store_by_domain.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type FetchDevStoreByDomainQuery = {
2020
storeType?: Types.Store | null
2121
primaryDomain?: string | null
2222
shortName?: string | null
23+
url?: string | null
2324
}
2425
}[]
2526
} | null
@@ -107,6 +108,7 @@ export const FetchDevStoreByDomain = {
107108
{kind: 'Field', name: {kind: 'Name', value: 'storeType'}},
108109
{kind: 'Field', name: {kind: 'Name', value: 'primaryDomain'}},
109110
{kind: 'Field', name: {kind: 'Name', value: 'shortName'}},
111+
{kind: 'Field', name: {kind: 'Name', value: 'url'}},
110112
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
111113
],
112114
},

packages/app/src/cli/api/graphql/business-platform-organizations/queries/fetch_dev_store_by_domain.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
storeType
1212
primaryDomain
1313
shortName
14+
url
1415
}
1516
}
1617
}

packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,11 +1292,12 @@ function mapBusinessPlatformStoresToOrganizationStores(
12921292
): OrganizationStore[] {
12931293
return storesArray.map((store: ShopNode) => {
12941294
const {externalId, primaryDomain, name, url} = store
1295-
if (!url) throw new BugError('The selected store does not have a valid URL')
1295+
const shopDomain = url ?? primaryDomain
1296+
if (!shopDomain) throw new BugError('The selected store does not have a valid URL')
12961297
return {
12971298
shopId: externalId ? idFromEncodedGid(externalId) : undefined,
12981299
link: primaryDomain,
1299-
shopDomain: normalizeStoreFqdn(url),
1300+
shopDomain: normalizeStoreFqdn(shopDomain),
13001301
shopName: name,
13011302
transferDisabled: true,
13021303
convertableToPartnerTest: true,

0 commit comments

Comments
 (0)