Skip to content

Commit 020012a

Browse files
WIP
1 parent 22f2bc6 commit 020012a

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

packages/app/src/cli/api/graphql/app-dev/generated/dev-session-create.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/co
77
export type DevSessionCreateMutationVariables = Types.Exact<{
88
appId: Types.Scalars['String']['input']
99
assetsUrl: Types.Scalars['String']['input']
10+
clientState?: Types.InputMaybe<Types.Scalars['JSON']['input']>
1011
}>
1112

1213
export type DevSessionCreateMutation = {
@@ -33,6 +34,11 @@ export const DevSessionCreate = {
3334
variable: {kind: 'Variable', name: {kind: 'Name', value: 'assetsUrl'}},
3435
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}},
3536
},
37+
{
38+
kind: 'VariableDefinition',
39+
variable: {kind: 'Variable', name: {kind: 'Name', value: 'clientState'}},
40+
type: {kind: 'NamedType', name: {kind: 'Name', value: 'JSON'}},
41+
},
3642
],
3743
selectionSet: {
3844
kind: 'SelectionSet',
@@ -51,6 +57,11 @@ export const DevSessionCreate = {
5157
name: {kind: 'Name', value: 'assetsUrl'},
5258
value: {kind: 'Variable', name: {kind: 'Name', value: 'assetsUrl'}},
5359
},
60+
{
61+
kind: 'Argument',
62+
name: {kind: 'Name', value: 'clientState'},
63+
value: {kind: 'Variable', name: {kind: 'Name', value: 'clientState'}},
64+
},
5465
],
5566
selectionSet: {
5667
kind: 'SelectionSet',

packages/app/src/cli/api/graphql/app-dev/queries/dev-session-create.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
mutation DevSessionCreate($appId: String!, $assetsUrl: String!) {
2-
devSessionCreate(appId: $appId, assetsUrl: $assetsUrl) {
1+
mutation DevSessionCreate($appId: String!, $assetsUrl: String!, $clientState: JSON) {
2+
devSessionCreate(appId: $appId, assetsUrl: $assetsUrl, clientState: $clientState) {
33
userErrors {
44
message
55
on

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any */
2-
import {JsonMapType} from '@shopify/cli-kit/node/toml'
3-
42
export type Maybe<T> = T | null
53
export type InputMaybe<T> = Maybe<T>
64
export type Exact<T extends {[key: string]: unknown}> = {[K in keyof T]: T[K]}
@@ -42,8 +40,6 @@ export type Scalars = {
4240
ISO8601Date: {input: any; output: any}
4341
/** An ISO 8601-encoded datetime */
4442
ISO8601DateTime: {input: any; output: any}
45-
/** Represents untyped JSON */
46-
JSON: {input: JsonMapType | string; output: JsonMapType}
4743
/** The ID for a LegalEntity. */
4844
LegalEntityID: {input: any; output: any}
4945
/** The ID for a OrganizationDomain. */

packages/app/src/cli/services/dev/processes/dev-session/dev-session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export class DevSession {
282282
assetsUrl: signedURL,
283283
manifest,
284284
inheritedModuleUids,
285+
clientState: {my_key: 'my_value'},
285286
}
286287
if (this.statusManager.status.isReady) {
287288
return this.devSessionUpdateWithRetry(payload)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ interface DevSessionSharedOptions {
158158
export interface DevSessionCreateOptions extends DevSessionSharedOptions {
159159
assetsUrl?: string
160160
manifest: AppManifest
161+
clientState?: JsonMapType
161162
}
162163

163164
export interface DevSessionUpdateOptions extends DevSessionSharedOptions {

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,12 +1013,17 @@ export class AppManagementClient implements DeveloperPlatformClient {
10131013
return appDeepLink({id, organizationId})
10141014
}
10151015

1016-
async devSessionCreate({appId, assetsUrl, shopFqdn}: DevSessionCreateOptions): Promise<DevSessionCreateMutation> {
1016+
async devSessionCreate({
1017+
appId,
1018+
assetsUrl,
1019+
shopFqdn,
1020+
clientState,
1021+
}: DevSessionCreateOptions): Promise<DevSessionCreateMutation> {
10171022
const appIdNumber = String(numberFromGid(appId))
10181023
return this.appDevRequest({
10191024
query: DevSessionCreate,
10201025
shopFqdn,
1021-
variables: {appId: appIdNumber, assetsUrl: assetsUrl ?? ''},
1026+
variables: {appId: appIdNumber, assetsUrl: assetsUrl ?? '', clientState},
10221027
requestOptions: {requestMode: 'slow-request'},
10231028
})
10241029
}

0 commit comments

Comments
 (0)