Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions packages/app/src/cli/api/graphql/app-dev/generated/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any, tsdoc/syntax */
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention, tsdoc/syntax */
import {JsonMapType} from '@shopify/cli-kit/node/toml'

export type Maybe<T> = T | null
Expand All @@ -15,12 +15,6 @@ export type Scalars = {
Boolean: {input: boolean; output: boolean}
Int: {input: number; output: number}
Float: {input: number; output: number}
/**
* Represents an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-encoded date and time string.
* For example, 3:50 pm on September 7, 2019 in the time zone of UTC (Coordinated Universal Time) is
* represented as `"2019-09-07T15:50:00Z`".
*/
DateTime: {input: any; output: any}
/**
* A [JSON](https://www.json.org/json-en.html) object.
*
Expand All @@ -37,12 +31,4 @@ export type Scalars = {
* }`
*/
JSON: {input: JsonMapType | string; output: JsonMapType}
/**
* Represents an [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) and
* [RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987)-compliant URI string.
*
* For example, `"https://example.myshopify.com"` is a valid URL. It includes a scheme (`https`) and a host
* (`example.myshopify.com`).
*/
URL: {input: string; output: string}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ export type BulkOperationsSortKeys =
| 'COMPLETED_AT'
/** Sort by the `created_at` value. */
| 'CREATED_AT'
/** Sort by the `status` value. */
| 'STATUS'

/**
* The possible HTTP methods that can be used when sending a request to upload a file using information from a
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-duplicate-type-constituents */
import * as Types from './types.js'

import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core'

export type FetchStoreByDomainQueryVariables = Types.Exact<{
domain?: Types.InputMaybe<Types.Scalars['String']['input']>
}>

export type FetchStoreByDomainQuery = {
organization?: {
id: string
name: string
accessibleShops?: {
edges: {
node: {
id: string
externalId?: string | null
name: string
storeType?: Types.Store | null
primaryDomain?: string | null
shortName?: string | null
url?: string | null
}
}[]
} | null
currentUser?: {organizationPermissions: string[]} | {organizationPermissions: string[]} | null
} | null
}

export const FetchStoreByDomain = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: {kind: 'Name', value: 'FetchStoreByDomain'},
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: {kind: 'Variable', name: {kind: 'Name', value: 'domain'}},
type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'organization'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'id'}},
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
{
kind: 'Field',
name: {kind: 'Name', value: 'accessibleShops'},
arguments: [
{
kind: 'Argument',
name: {kind: 'Name', value: 'search'},
value: {kind: 'Variable', name: {kind: 'Name', value: 'domain'}},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'edges'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {kind: 'Name', value: 'node'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'id'}},
{kind: 'Field', name: {kind: 'Name', value: 'externalId'}},
{kind: 'Field', name: {kind: 'Name', value: 'name'}},
{kind: 'Field', name: {kind: 'Name', value: 'storeType'}},
{kind: 'Field', name: {kind: 'Name', value: 'primaryDomain'}},
{kind: 'Field', name: {kind: 'Name', value: 'shortName'}},
{kind: 'Field', name: {kind: 'Name', value: 'url'}},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{
kind: 'Field',
name: {kind: 'Name', value: 'currentUser'},
selectionSet: {
kind: 'SelectionSet',
selections: [
{kind: 'Field', name: {kind: 'Name', value: 'organizationPermissions'}},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
{kind: 'Field', name: {kind: 'Name', value: '__typename'}},
],
},
},
],
},
},
],
} as unknown as DocumentNode<FetchStoreByDomainQuery, FetchStoreByDomainQueryVariables>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
query FetchStoreByDomain($domain: String) {
organization {
id
name
accessibleShops(search: $domain) {
edges {
node {
id
externalId
name
storeType
primaryDomain
shortName
url
}
}
}
currentUser {
organizationPermissions
}
}
}
2 changes: 1 addition & 1 deletion packages/app/src/cli/commands/app/bulk/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class BulkExecute extends AppLinkedCommand {
await executeBulkOperation({
organization: appContextResult.organization,
remoteApp: appContextResult.remoteApp,
storeFqdn: store.shopDomain,
store,
query,
variables: flags.variables,
variableFile: flags['variable-file'],
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/cli/commands/app/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Execute extends AppLinkedCommand {
await executeOperation({
organization: appContextResult.organization,
remoteApp: appContextResult.remoteApp,
storeFqdn: store.shopDomain,
store,
query,
variables: flags.variables,
outputFile: flags['output-file'],
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/cli/models/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ export interface OrganizationStore {
transferDisabled: boolean
convertableToPartnerTest: boolean
provisionable: boolean
storeType?: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ describe('executeBulkOperation', () => {
} as OrganizationApp

const storeFqdn = 'test-store.myshopify.com'
const mockStore = {
shopId: '123',
link: 'link',
shopDomain: storeFqdn,
shopName: 'Test Store',
transferDisabled: true,
convertableToPartnerTest: false,
provisionable: true,
storeType: 'APP_DEVELOPMENT',
}
const mockAdminSession = {token: 'test-token', storeFqdn}

const createdBulkOperation: NonNullable<
Expand Down Expand Up @@ -87,7 +97,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
})

Expand All @@ -110,7 +120,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
})

Expand All @@ -133,7 +143,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query: mutation,
})

Expand All @@ -158,7 +168,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query: mutation,
variables,
})
Expand All @@ -181,7 +191,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
})

Expand All @@ -206,7 +216,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
})

Expand Down Expand Up @@ -242,7 +252,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query: mutation,
variableFile: variableFilePath,
})
Expand All @@ -265,7 +275,7 @@ describe('executeBulkOperation', () => {
executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query: mutation,
variableFile: nonExistentPath,
}),
Expand All @@ -284,7 +294,7 @@ describe('executeBulkOperation', () => {
executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
variables,
}),
Expand All @@ -305,7 +315,7 @@ describe('executeBulkOperation', () => {
executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
variableFile: variableFilePath,
}),
Expand Down Expand Up @@ -338,7 +348,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
watch: true,
})
Expand Down Expand Up @@ -378,7 +388,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
watch: true,
})
Expand Down Expand Up @@ -467,7 +477,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
watch: true,
outputFile,
Expand Down Expand Up @@ -501,7 +511,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
watch: true,
})
Expand Down Expand Up @@ -530,7 +540,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
watch: true,
})
Expand All @@ -555,7 +565,7 @@ describe('executeBulkOperation', () => {
executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
}),
).rejects.toThrow('Bulk operation response returned null with no error message.')
Expand Down Expand Up @@ -688,7 +698,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
})

Expand All @@ -711,7 +721,7 @@ describe('executeBulkOperation', () => {
await executeBulkOperation({
organization: mockOrganization,
remoteApp: mockRemoteApp,
storeFqdn,
store: mockStore,
query,
})

Expand Down
Loading
Loading