Skip to content

Commit b4037c3

Browse files
Merge pull request #6283 from Shopify/dlm-destinations-api-reconfigure
Use updated destinations API for ListOrganizations
2 parents 2891b84 + 0f86d93 commit b4037c3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/co
66
export type ListOrganizationsQueryVariables = Types.Exact<{[key: string]: never}>
77

88
export type ListOrganizationsQuery = {
9-
currentUserAccount?: {uuid: string; organizations: {nodes: {id: string; name: string}[]}} | null
9+
currentUserAccount?: {
10+
uuid: string
11+
organizationsWithAccessToDestination: {nodes: {id: string; name: string}[]}
12+
} | null
1013
}
1114

1215
export const ListOrganizations = {
@@ -28,12 +31,12 @@ export const ListOrganizations = {
2831
{kind: 'Field', name: {kind: 'Name', value: 'uuid'}},
2932
{
3033
kind: 'Field',
31-
name: {kind: 'Name', value: 'organizations'},
34+
name: {kind: 'Name', value: 'organizationsWithAccessToDestination'},
3235
arguments: [
3336
{
3437
kind: 'Argument',
35-
name: {kind: 'Name', value: 'hasAccessToDestination'},
36-
value: {kind: 'EnumValue', value: 'DEVELOPER_DASHBOARD'},
38+
name: {kind: 'Name', value: 'destination'},
39+
value: {kind: 'EnumValue', value: 'APPS_CLI'},
3740
},
3841
],
3942
selectionSet: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
query ListOrganizations {
22
currentUserAccount {
33
uuid
4-
organizations(hasAccessToDestination: DEVELOPER_DASHBOARD) {
4+
organizationsWithAccessToDestination(destination: APPS_CLI) {
55
nodes {
66
id
77
name

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
361361
async organizations(): Promise<Organization[]> {
362362
const organizationsResult = await this.businessPlatformRequest({query: ListOrganizations})
363363
if (!organizationsResult.currentUserAccount) return []
364-
return organizationsResult.currentUserAccount.organizations.nodes.map((org) => ({
364+
return organizationsResult.currentUserAccount.organizationsWithAccessToDestination.nodes.map((org) => ({
365365
id: idFromEncodedGid(org.id),
366366
businessName: `${org.name} (Dev Dashboard)`,
367367
source: this.organizationSource,

0 commit comments

Comments
 (0)