-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port fetchTheme / fetchThemes to graphQL
- Loading branch information
Showing
6 changed files
with
209 additions
and
14 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
packages/cli-kit/src/cli/api/graphql/admin/generated/get_theme.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,54 @@ | ||
/* 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 GetThemeQueryVariables = Types.Exact<{ | ||
id: Types.Scalars['ID']['input'] | ||
}> | ||
|
||
export type GetThemeQuery = {theme?: {id: string; name: string; role: Types.ThemeRole; processing: boolean} | null} | ||
|
||
export const GetTheme = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'query', | ||
name: {kind: 'Name', value: 'getTheme'}, | ||
variableDefinitions: [ | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'id'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'ID'}}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'theme'}, | ||
arguments: [ | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'id'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'id'}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{kind: 'Field', name: {kind: 'Name', value: 'id'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'name'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'role'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'processing'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} as unknown as DocumentNode<GetThemeQuery, GetThemeQueryVariables> |
82 changes: 82 additions & 0 deletions
82
packages/cli-kit/src/cli/api/graphql/admin/generated/get_themes.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,82 @@ | ||
/* 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 GetThemesQueryVariables = Types.Exact<{ | ||
after?: Types.InputMaybe<Types.Scalars['String']['input']> | ||
}> | ||
|
||
export type GetThemesQuery = { | ||
themes?: { | ||
nodes: {id: string; name: string; role: Types.ThemeRole; processing: boolean}[] | ||
pageInfo: {hasNextPage: boolean; endCursor?: string | null} | ||
} | null | ||
} | ||
|
||
export const GetThemes = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'query', | ||
name: {kind: 'Name', value: 'getThemes'}, | ||
variableDefinitions: [ | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'after'}}, | ||
type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'themes'}, | ||
arguments: [ | ||
{kind: 'Argument', name: {kind: 'Name', value: 'first'}, value: {kind: 'IntValue', value: '50'}}, | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'after'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'after'}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'nodes'}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{kind: 'Field', name: {kind: 'Name', value: 'id'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'name'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'role'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'processing'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'pageInfo'}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{kind: 'Field', name: {kind: 'Name', value: 'hasNextPage'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'endCursor'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} as unknown as DocumentNode<GetThemesQuery, GetThemesQueryVariables> |
9 changes: 9 additions & 0 deletions
9
packages/cli-kit/src/cli/api/graphql/admin/queries/get_theme.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,9 @@ | ||
|
||
query getTheme($id: ID!) { | ||
theme(id: $id) { | ||
id | ||
name | ||
role | ||
processing | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/cli-kit/src/cli/api/graphql/admin/queries/get_themes.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,15 @@ | ||
|
||
query getThemes($after: String) { | ||
themes(first: 50, after: $after) { | ||
nodes { | ||
id | ||
name | ||
role | ||
processing | ||
} | ||
pageInfo { | ||
hasNextPage | ||
endCursor | ||
} | ||
} | ||
} |
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
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