-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use themeFilesUpsert graphQL instead of REST
- Loading branch information
Showing
9 changed files
with
352 additions
and
145 deletions.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
packages/cli-kit/src/cli/api/graphql/admin/generated/theme_files_upsert.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
import * as Types from './types.js' | ||
|
||
import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core' | ||
|
||
export type ThemeFilesUpsertMutationVariables = Types.Exact<{ | ||
files: Types.OnlineStoreThemeFilesUpsertFileInput[] | Types.OnlineStoreThemeFilesUpsertFileInput | ||
themeId: Types.Scalars['ID']['input'] | ||
}> | ||
|
||
export type ThemeFilesUpsertMutation = { | ||
themeFilesUpsert?: { | ||
upsertedThemeFiles?: {filename: string}[] | null | ||
userErrors: {filename?: string | null; message: string}[] | ||
} | null | ||
} | ||
|
||
export const ThemeFilesUpsert = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'mutation', | ||
name: {kind: 'Name', value: 'themeFilesUpsert'}, | ||
variableDefinitions: [ | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'files'}}, | ||
type: { | ||
kind: 'NonNullType', | ||
type: { | ||
kind: 'ListType', | ||
type: { | ||
kind: 'NonNullType', | ||
type: {kind: 'NamedType', name: {kind: 'Name', value: 'OnlineStoreThemeFilesUpsertFileInput'}}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'themeId'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'ID'}}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'themeFilesUpsert'}, | ||
arguments: [ | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'files'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'files'}}, | ||
}, | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'themeId'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'themeId'}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'upsertedThemeFiles'}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{kind: 'Field', name: {kind: 'Name', value: 'filename'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'userErrors'}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{kind: 'Field', name: {kind: 'Name', value: 'filename'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'message'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} as unknown as DocumentNode<ThemeFilesUpsertMutation, ThemeFilesUpsertMutationVariables> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/cli-kit/src/cli/api/graphql/admin/mutations/theme_files_upsert.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
mutation themeFilesUpsert($files: [OnlineStoreThemeFilesUpsertFileInput!]!, $themeId: ID!) { | ||
themeFilesUpsert(files: $files, themeId: $themeId) { | ||
upsertedThemeFiles { | ||
filename | ||
} | ||
userErrors { | ||
filename | ||
message | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.