Create queries, mutations and subscriptions

This commit is contained in:
schroda
2023-08-05 01:03:40 +02:00
parent ae5d2525f1
commit 55c1c51edd
26 changed files with 1675 additions and 0 deletions

View File

@@ -0,0 +1,439 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
export const PAGE_INFO = gql`
fragment PAGE_INFO on PageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
`;
export const GLOBAL_METADATA = gql`
fragment GLOBAL_METADATA on GlobalMetaType {
key
value
}
`;
export const FULL_CATEGORY_FIELDS = gql`
fragment FULL_CATEGORY_FIELDS on CategoryType {
default
id
includeInUpdate
name
order
meta {
key
value
}
mangas {
totalCount
}
}
`;
export const PARTIAL_SOURCE_FIELDS = gql`
fragment PARTIAL_SOURCE_FIELDS on SourceType {
displayName
iconUrl
id
isConfigurable
isNsfw
lang
name
supportsLatest
}
`;
export const FULL_SOURCE_FIELDS = gql`
${PARTIAL_SOURCE_FIELDS}
fragment FULL_SOURCE_FIELDS on SourceType {
...PARTIAL_SOURCE_FIELDS
preferences {
... on CheckBoxPreference {
type: __typename
CheckBoxCheckBoxCurrentValue: currentValue
summary
CheckBoxDefault: default
key
CheckBoxTitle: title
}
... on EditTextPreference {
type: __typename
EditTextPreferenceCurrentValue: currentValue
EditTextPreferenceDefault: default
EditTextPreferenceTitle: title
text
summary
key
dialogTitle
dialogMessage
}
... on SwitchPreference {
type: __typename
SwitchPreferenceCurrentValue: currentValue
summary
key
SwitchPreferenceDefault: default
SwitchPreferenceTitle: title
}
... on MultiSelectListPreference {
type: __typename
dialogMessage
dialogTitle
MultiSelectListPreferenceTitle: title
summary
key
entryValues
entries
MultiSelectListPreferenceDefault: default
MultiSelectListPreferenceCurrentValue: currentValue
}
... on ListPreference {
type: __typename
ListPreferenceCurrentValue: currentValue
ListPreferenceDefault: default
ListPreferenceTitle: title
summary
key
entryValues
entries
}
}
filters {
... on TriStateFilter {
type: __typename
name
TriStateFilterDefault: default
}
... on CheckBoxFilter {
type: __typename
CheckBoxFilterDefault: default
name
}
... on TextFilter {
type: __typename
name
TextFilterDefault: default
}
... on SortFilter {
type: __typename
values
name
SortFilterDefault: default {
ascending
index
}
}
... on SeparatorFilter {
type: __typename
name
}
... on SelectFilter {
type: __typename
values
name
SelectFilterDefault: default
}
... on HeaderFilter {
type: __typename
name
}
... on GroupFilter {
type: __typename
name
filters {
... on CheckBoxFilter {
type: __typename
CheckBoxFilterDefault: default
name
}
... on HeaderFilter {
type: __typename
name
}
... on SelectFilter {
type: __typename
SelectFilterDefault: default
name
values
}
... on TriStateFilter {
type: __typename
TriStateFilterDefault: default
name
}
... on TextFilter {
type: __typename
TextFilterDefault: default
name
}
... on SortFilter {
type: __typename
SorSortFilterDefault: default {
ascending
index
}
name
values
}
... on SeparatorFilter {
type: __typename
name
}
}
}
}
}
`;
export const BASE_MANGA_FIELDS = gql`
${PARTIAL_SOURCE_FIELDS}
fragment BASE_MANGA_FIELDS on MangaType {
artist
author
chaptersLastFetchedAt
description
genre
id
inLibrary
inLibraryAt
initialized
lastFetchedAt
meta {
key
value
}
realUrl
source {
...PARTIAL_SOURCE_FIELDS
}
status
thumbnailUrl
title
url
}
`;
export const PARTIAL_MANGA_FIELDS = gql`
${BASE_MANGA_FIELDS}
${FULL_CATEGORY_FIELDS}
${PARTIAL_SOURCE_FIELDS}
fragment PARTIAL_MANGA_FIELDS on MangaType {
...BASE_MANGA_FIELDS
unreadCount
downloadCount
categories {
nodes {
...FULL_CATEGORY_FIELDS
}
totalCount
}
chapters {
totalCount
}
}
`;
export const FULL_CHAPTER_FIELDS = gql`
${PARTIAL_MANGA_FIELDS}
fragment FULL_CHAPTER_FIELDS on ChapterType {
chapterNumber
fetchedAt
id
isBookmarked
isDownloaded
isRead
lastPageRead
lastReadAt
manga {
...PARTIAL_MANGA_FIELDS
}
meta {
key
value
}
name
pageCount
realUrl
scanlator
sourceOrder
uploadDate
url
}
`;
export const FULL_MANGA_FIELDS = gql`
${PARTIAL_MANGA_FIELDS}
${FULL_CHAPTER_FIELDS}
fragment FULL_MANGA_FIELDS on MangaType {
...PARTIAL_MANGA_FIELDS
lastReadChapter {
...FULL_CHAPTER_FIELDS
}
}
`;
export const FULL_EXTENSION_FIELDS = gql`
fragment FULL_EXTENSION_FIELDS on ExtensionType {
apkName
hasUpdate
iconUrl
isInstalled
isNsfw
isObsolete
lang
name
pkgName
versionCode
versionName
}
`;
export const FULL_DOWNLOAD_STATUS = gql`
${FULL_CHAPTER_FIELDS}
fragment FULL_DOWNLOAD_STATUS on DownloadStatus {
queue {
chapter {
...FULL_CHAPTER_FIELDS
}
progress
state
tries
}
state
}
`;
export const PARTIAL_UPDATER_STATUS = gql`
fragment PARTIAL_UPDATER_STATUS on UpdateStatus {
isRunning
}
`;
export const FULL_UPDATER_STATUS = gql`
${FULL_MANGA_FIELDS}
${PARTIAL_UPDATER_STATUS}
${FULL_CATEGORY_FIELDS}
fragment FULL_UPDATER_STATUS on UpdateStatus {
...PARTIAL_UPDATER_STATUS
completeJobs {
mangas {
nodes {
...FULL_MANGA_FIELDS
}
totalCount
}
}
failedJobs {
mangas {
nodes {
...FULL_MANGA_FIELDS
}
totalCount
}
}
pendingJobs {
mangas {
nodes {
...FULL_MANGA_FIELDS
}
totalCount
}
}
runningJobs {
mangas {
nodes {
...FULL_MANGA_FIELDS
}
totalCount
}
}
skippedJobs {
mangas {
nodes {
...FULL_MANGA_FIELDS
}
totalCount
}
}
updatingCategories {
categories {
nodes {
...FULL_CATEGORY_FIELDS
}
totalCount
}
}
skippedCategories {
categories {
nodes {
...FULL_CATEGORY_FIELDS
}
totalCount
}
}
}
`;
export const WEBUI_UPDATE_INFO = gql`
fragment WEBUI_UPDATE_INFO on WebUIUpdateInfo {
channel
tag
updateAvailable
}
`;
export const WEBUI_UPDATE_STATUS = gql`
${WEBUI_UPDATE_INFO}
fragment WEBUI_UPDATE_STATUS on WebUIUpdateStatus {
info {
...WEBUI_UPDATE_INFO
}
progress
state
}
`;
export const SERVER_SETTINGS = gql`
fragment SERVER_SETTINGS on SettingsType {
autoDownloadNewChapters
backupInterval
backupPath
backupTTL
backupTime
basicAuthEnabled
basicAuthPassword
basicAuthUsername
debugLogsEnabled
downloadAsCbz
downloadsPath
electronPath
excludeCompleted
excludeNotStarted
excludeUnreadChapters
globalUpdateInterval
initialOpenInBrowserEnabled
ip
localSourcePath
maxSourcesInParallel
port
socksProxyEnabled
socksProxyHost
socksProxyPort
systemTrayEnabled
webUIChannel
webUIFlavor
webUIInterface
webUIUpdateCheckInterval
}
`;

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
export const CREATE_BACKUP = gql`
mutation CREATE_BACKUP($input: CreateBackupInput!) {
createBackup(input: $input) {
clientMutationId
url
}
}
`;
export const RESTORE_BACKUP = gql`
mutation RESTORE_BACKUP($input: RestoreBackupInput!) {
restoreBackup(input: $input) {
clientMutationId
status {
mangaProgress
state
totalManga
}
}
}
`;

View File

@@ -0,0 +1,105 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_CATEGORY_FIELDS } from '@/lib/graphql/Fragments';
export const CREATE_CATEGORY = gql`
${FULL_CATEGORY_FIELDS}
mutation CREATE_CATEGORY($input: CreateCategoryInput!) {
createCategory(input: $input) {
clientMutationId
category {
...FULL_CATEGORY_FIELDS
}
}
}
`;
export const DELETE_CATEGORY = gql`
${FULL_CATEGORY_FIELDS}
mutation DELETE_CATEGORY($input: DeleteCategoryInput!) {
deleteCategory(input: $input) {
clientMutationId
category {
...FULL_CATEGORY_FIELDS
}
}
}
`;
export const DELETE_CATEGORY_METADATA = gql`
${FULL_CATEGORY_FIELDS}
mutation DELETE_CATEGORY_METADATA($input: DeleteCategoryMetaInput!) {
deleteCategoryMeta(input: $input) {
clientMutationId
meta {
key
value
category {
...FULL_CATEGORY_FIELDS
}
}
category {
...FULL_CATEGORY_FIELDS
}
}
}
`;
export const SET_CATEGORY_METADATA = gql`
${FULL_CATEGORY_FIELDS}
mutation SET_CATEGORY_METADATA($input: SetCategoryMetaInput!) {
setCategoryMeta(input: $input) {
clientMutationId
meta {
key
value
category {
...FULL_CATEGORY_FIELDS
}
}
}
}
`;
export const UPDATE_CATEGORY = gql`
${FULL_CATEGORY_FIELDS}
mutation UPDATE_CATEGORY($input: UpdateCategoryInput!) {
updateCategory(input: $input) {
clientMutationId
category {
...FULL_CATEGORY_FIELDS
}
}
}
`;
export const UPDATE_CATEGORIES = gql`
${FULL_CATEGORY_FIELDS}
mutation UPDATE_CATEGORIES($input: UpdateCategoriesInput!) {
updateCategories(input: $input) {
clientMutationId
categories {
...FULL_CATEGORY_FIELDS
}
}
}
`;
export const UPDATE_CATEGORY_ORDER = gql`
${FULL_CATEGORY_FIELDS}
mutation UPDATE_CATEGORY_ORDER($input: UpdateCategoryOrderInput!) {
updateCategoryOrder(input: $input) {
clientMutationId
categories {
...FULL_CATEGORY_FIELDS
}
}
}
`;

View File

@@ -0,0 +1,96 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_CHAPTER_FIELDS } from '@/lib/graphql/Fragments';
export const DELETE_CHAPTER_METADATA = gql`
${FULL_CHAPTER_FIELDS}
mutation DELETE_CHAPTER_METADATA($input: DeleteChapterMetaInput!) {
deleteChapterMeta(input: $input) {
clientMutationId
meta {
key
value
chapter {
...FULL_CHAPTER_FIELDS
}
}
chapter {
...FULL_CHAPTER_FIELDS
}
}
}
`;
// makes the server fetch and return the pages of a chapter
export const GET_CHAPTER_PAGES_FETCH = gql`
${FULL_CHAPTER_FIELDS}
mutation GET_CHAPTER_PAGES_FETCH($input: FetchChapterPagesInput!) {
fetchChapterPages(input: $input) {
clientMutationId
chapter {
...FULL_CHAPTER_FIELDS
}
pages
}
}
`;
// makes the server fetch and return the chapters of the manga
export const GET_MANGA_CHAPTERS_FETCH = gql`
${FULL_CHAPTER_FIELDS}
mutation GET_MANGA_CHAPTERS_FETCH($input: FetchChaptersInput!) {
fetchChapters(input: $input) {
clientMutationId
chapters {
...FULL_CHAPTER_FIELDS
}
}
}
`;
export const SET_CHAPTER_METADATA = gql`
${FULL_CHAPTER_FIELDS}
mutation SET_CHAPTER_METADATA($input: SetChapterMetaInput!) {
setChapterMeta(input: $input) {
clientMutationId
meta {
key
value
chapter {
...FULL_CHAPTER_FIELDS
}
}
}
}
`;
export const UPDATE_CHAPTER = gql`
${FULL_CHAPTER_FIELDS}
mutation UPDATE_CHAPTER($input: UpdateChapterInput!) {
updateChapter(input: $input) {
clientMutationId
chapter {
...FULL_CHAPTER_FIELDS
}
}
}
`;
export const UPDATE_CHAPTERS = gql`
${FULL_CHAPTER_FIELDS}
mutation UPDATE_CHAPTERS($input: UpdateChaptersInput!) {
updateChapters(input: $input) {
clientMutationId
chapters {
...FULL_CHAPTER_FIELDS
}
}
}
`;

View File

@@ -0,0 +1,130 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_CHAPTER_FIELDS, FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
export const CLEAR_DOWNLOADER = gql`
${FULL_DOWNLOAD_STATUS}
mutation CLEAR_DOWNLOADER($input: ClearDownloaderInput = {}) {
clearDownloader(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;
export const DELETE_DOWNLOADED_CHAPTER = gql`
${FULL_CHAPTER_FIELDS}
mutation DELETE_DOWNLOADED_CHAPTER($input: DeleteDownloadedChapterInput!) {
deleteDownloadedChapter(input: $input) {
clientMutationId
chapters {
...FULL_CHAPTER_FIELDS
}
}
}
`;
export const DELETE_DOWNLOADED_CHAPTERS = gql`
${FULL_CHAPTER_FIELDS}
mutation DELETE_DOWNLOADED_CHAPTERS($input: DeleteDownloadedChaptersInput!) {
deleteDownloadedChapters(input: $input) {
clientMutationId
chapters {
...FULL_CHAPTER_FIELDS
}
}
}
`;
export const DEQUEUE_CHAPTER_DOWNLOAD = gql`
${FULL_DOWNLOAD_STATUS}
mutation DEQUEUE_CHAPTER_DOWNLOAD($input: DequeueChapterDownloadInput!) {
dequeueChapterDownload(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;
export const DEQUEUE_CHAPTER_DOWNLOADS = gql`
${FULL_DOWNLOAD_STATUS}
mutation DEQUEUE_CHAPTER_DOWNLOADS($input: DequeueChapterDownloadsInput!) {
dequeueChapterDownloads(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;
export const ENQUEUE_CHAPTER_DOWNLOAD = gql`
${FULL_DOWNLOAD_STATUS}
mutation ENQUEUE_CHAPTER_DOWNLOAD($input: EnqueueChapterDownloadInput!) {
enqueueChapterDownload(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;
export const ENQUEUE_CHAPTER_DOWNLOADS = gql`
${FULL_DOWNLOAD_STATUS}
mutation ENQUEUE_CHAPTER_DOWNLOADS($input: EnqueueChapterDownloadsInput!) {
enqueueChapterDownloads(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;
export const REORDER_CHAPTER_DOWNLOAD = gql`
${FULL_DOWNLOAD_STATUS}
mutation REORDER_CHAPTER_DOWNLOAD($input: ReorderChapterDownloadInput!) {
reorderChapterDownload(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;
export const START_DOWNLOADER = gql`
${FULL_DOWNLOAD_STATUS}
mutation START_DOWNLOADER($input: StartDownloaderInput = {}) {
startDownloader(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;
export const STOP_DOWNLOADER = gql`
${FULL_DOWNLOAD_STATUS}
mutation STOP_DOWNLOADER($input: StopDownloaderInput = {}) {
stopDownloader(input: $input) {
clientMutationId
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
}
`;

View File

@@ -0,0 +1,59 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_EXTENSION_FIELDS } from '@/lib/graphql/Fragments';
// makes the server fetch and return the latest extensions
export const GET_EXTENSIONS_FETCH = gql`
${FULL_EXTENSION_FIELDS}
mutation GET_EXTENSIONS_FETCH($input: FetchExtensionsInput = {}) {
fetchExtensions(input: $input) {
clientMutationId
extensions {
...FULL_EXTENSION_FIELDS
}
}
}
`;
export const UPDATE_EXTENSION = gql`
${FULL_EXTENSION_FIELDS}
mutation UPDATE_EXTENSION($input: UpdateExtensionInput!) {
updateExtension(input: $input) {
clientMutationId
extension {
...FULL_EXTENSION_FIELDS
}
}
}
`;
export const UPDATE_EXTENSIONS = gql`
${FULL_EXTENSION_FIELDS}
mutation UPDATE_EXTENSIONS($input: UpdateExtensionsInput!) {
updateExtensions(input: $input) {
clientMutationId
extensions {
...FULL_EXTENSION_FIELDS
}
}
}
`;
export const INSTALL_EXTERNAL_EXTENSION = gql`
${FULL_EXTENSION_FIELDS}
mutation INSTALL_EXTERNAL_EXTENSION($file: Upload!) {
installExternalExtension(input: { extensionFile: $file }) {
extension {
...FULL_EXTENSION_FIELDS
}
clientMutationId
}
}
`;

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { GLOBAL_METADATA } from '@/lib/graphql/Fragments';
export const DELETE_GLOBAL_METADATA = gql`
${GLOBAL_METADATA}
mutation DELETE_GLOBAL_METADATA($input: DeleteGlobalMetaInput!) {
deleteGlobalMeta(input: $input) {
clientMutationId
meta {
...GLOBAL_METADATA
}
}
}
`;
export const SET_GLOBAL_METADATA = gql`
${GLOBAL_METADATA}
mutation SET_GLOBAL_METADATA($input: SetGlobalMetaInput!) {
setGlobalMeta(input: $input) {
clientMutationId
meta {
...GLOBAL_METADATA
}
}
}
`;

View File

@@ -0,0 +1,106 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_MANGA_FIELDS } from '@/lib/graphql/Fragments';
export const DELETE_MANGA_METADATA = gql`
${FULL_MANGA_FIELDS}
mutation DELETE_MANGA_METADATA($input: DeleteMangaMetaInput!) {
deleteMangaMeta(input: $input) {
clientMutationId
meta {
key
value
manga {
...FULL_MANGA_FIELDS
}
}
manga {
...FULL_MANGA_FIELDS
}
}
}
`;
// makes the server fetch and return the manga
export const GET_MANGA_FETCH = gql`
${FULL_MANGA_FIELDS}
mutation GET_MANGA_FETCH($input: FetchMangaInput!) {
fetchManga(input: $input) {
clientMutationId
manga {
...FULL_MANGA_FIELDS
}
}
}
`;
export const SET_MANGA_METADATA = gql`
${FULL_MANGA_FIELDS}
mutation SET_MANGA_METADATA($input: SetMangaMetaInput!) {
setMangaMeta(input: $input) {
clientMutationId
meta {
key
value
manga {
...FULL_MANGA_FIELDS
}
}
}
}
`;
export const UPDATE_MANGA = gql`
${FULL_MANGA_FIELDS}
mutation UPDATE_MANGA($input: UpdateMangaInput!) {
updateManga(input: $input) {
clientMutationId
manga {
...FULL_MANGA_FIELDS
}
}
}
`;
export const UPDATE_MANGA_CATEGORIES = gql`
${FULL_MANGA_FIELDS}
mutation UPDATE_MANGA_CATEGORIES($input: UpdateMangaCategoriesInput!) {
updateMangaCategories(input: $input) {
clientMutationId
manga {
...FULL_MANGA_FIELDS
}
}
}
`;
export const UPDATE_MANGAS = gql`
${FULL_MANGA_FIELDS}
mutation UPDATE_MANGAS($input: UpdateMangasInput!) {
updateMangas(input: $input) {
clientMutationId
mangas {
...FULL_MANGA_FIELDS
}
}
}
`;
export const UPDATE_MANGAS_CATEGORIES = gql`
${FULL_MANGA_FIELDS}
mutation UPDATE_MANGAS_CATEGORIES($input: UpdateMangasCategoriesInput!) {
updateMangasCategories(input: $input) {
clientMutationId
mangas {
...FULL_MANGA_FIELDS
}
}
}
`;

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { WEBUI_UPDATE_STATUS } from '@/lib/graphql/Fragments';
// eslint-disable-next-line import/prefer-default-export
export const UPDATE_WEBUI = gql`
${WEBUI_UPDATE_STATUS}
mutation UPDATE_WEBUI($input: WebUIUpdateInput = {}) {
updateWebUI(input: $input) {
clientMutationId
updateStatus {
...WEBUI_UPDATE_STATUS
}
}
}
`;

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { SERVER_SETTINGS } from '@/lib/graphql/Fragments';
export const RESET_SERVER_SETTINGS = gql`
${SERVER_SETTINGS}
mutation RESET_SERVER_SETTINGS($input: ResetSettingsInput!) {
resetSettings(input: $input) {
clientMutationId
settings {
...SERVER_SETTINGS
}
}
}
`;
export const UPDATE_SERVER_SETTINGS = gql`
${SERVER_SETTINGS}
mutation UPDATE_SERVER_SETTINGS($input: SetSettingsInput!) {
setSettings(input: $input) {
clientMutationId
settings {
...SERVER_SETTINGS
}
}
}
`;

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_MANGA_FIELDS, FULL_SOURCE_FIELDS } from '@/lib/graphql/Fragments';
export const GET_SOURCE_MANGAS_FETCH = gql`
${FULL_MANGA_FIELDS}
mutation GET_SOURCE_MANGAS_FETCH($input: FetchSourceMangaInput!) {
fetchSourceManga(input: $input) {
clientMutationId
hasNextPage
mangas {
...FULL_MANGA_FIELDS
}
}
}
`;
export const UPDATE_SOURCE_PREFERENCES = gql`
${FULL_SOURCE_FIELDS}
mutation UPDATE_SOURCE_PREFERENCES($input: UpdateSourcePreferenceInput!) {
updateSourcePreference(input: $input) {
clientMutationId
source {
...FULL_SOURCE_FIELDS
}
}
}
`;

View File

@@ -0,0 +1,42 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { PARTIAL_UPDATER_STATUS } from '@/lib/graphql/Fragments';
export const UPDATE_CATEGORY_MANGAS = gql`
${PARTIAL_UPDATER_STATUS}
mutation UPDATE_CATEGORY_MANGAS($input: UpdateCategoryMangaInput!) {
updateCategoryManga(input: $input) {
clientMutationId
updateStatus {
...PARTIAL_UPDATER_STATUS
}
}
}
`;
export const UPDATE_LIBRARY_MANGAS = gql`
${PARTIAL_UPDATER_STATUS}
mutation UPDATE_LIBRARY_MANGAS($input: UpdateLibraryMangaInput = {}) {
updateLibraryManga(input: $input) {
clientMutationId
updateStatus {
...PARTIAL_UPDATER_STATUS
}
}
}
`;
export const STOP_UPDATER = gql`
mutation STOP_UPDATER($input: UpdateStopInput = {}) {
updateStop(input: $input) {
clientMutationId
}
}
`;

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
export const VALIDATE_BACKUP = gql`
query VALIDATE_BACKUP($input: ValidateBackupInput!) {
validateBackup(input: $input) {
missingSources {
id
name
}
}
}
`;
export const GET_RESTORE_STATUS = gql`
query GET_RESTORE_STATUS {
restoreStatus {
mangaProgress
state
totalManga
}
}
`;

View File

@@ -0,0 +1,73 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_CATEGORY_FIELDS, FULL_MANGA_FIELDS, PAGE_INFO } from '@/lib/graphql/Fragments';
export const GET_CATEGORIES = gql`
${FULL_CATEGORY_FIELDS}
${PAGE_INFO}
query GET_CATEGORIES(
$after: Cursor
$before: Cursor
$condition: CategoryConditionInput
$filter: CategoryFilterInput
$first: Int
$last: Int
$offset: Int
$orderBy: CategoryOrderBy
$orderByType: SortOrder
) {
categories(
after: $after
before: $before
condition: $condition
filter: $filter
first: $first
last: $last
offset: $offset
orderBy: $orderBy
orderByType: $orderByType
) {
nodes {
...FULL_CATEGORY_FIELDS
}
pageInfo {
...PAGE_INFO
}
totalCount
}
}
`;
export const GET_CATEGORY = gql`
${FULL_CATEGORY_FIELDS}
query GET_CATEGORY($id: Int!) {
category(id: $id) {
...FULL_CATEGORY_FIELDS
}
}
`;
export const GET_CATEGORY_MANGAS = gql`
${FULL_MANGA_FIELDS}
${PAGE_INFO}
query GET_CATEGORY_MANGAS($id: Int!) {
category(id: $id) {
mangas {
nodes {
...FULL_MANGA_FIELDS
}
pageInfo {
...PAGE_INFO
}
totalCount
}
}
}
`;

View File

@@ -0,0 +1,57 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_CHAPTER_FIELDS, PAGE_INFO } from '@/lib/graphql/Fragments';
// returns the current chapter from the database
export const GET_CHAPTER = gql`
${FULL_CHAPTER_FIELDS}
query GET_CHAPTER($id: Int!) {
chapter(id: $id) {
...FULL_CHAPTER_FIELDS
}
}
`;
// returns the current chapters from the database
export const GET_CHAPTERS = gql`
${FULL_CHAPTER_FIELDS}
${PAGE_INFO}
query GET_CHAPTERS(
$after: Cursor
$before: Cursor
$condition: ChapterConditionInput
$filter: ChapterFilterInput
$first: Int
$last: Int
$offset: Int
$orderBy: ChapterOrderBy
$orderByType: SortOrder
) {
chapters(
after: $after
before: $before
condition: $condition
filter: $filter
first: $first
last: $last
offset: $offset
orderBy: $orderBy
orderByType: $orderByType
) {
nodes {
...FULL_CHAPTER_FIELDS
}
pageInfo {
...PAGE_INFO
}
totalCount
}
}
`;

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
// eslint-disable-next-line import/prefer-default-export
export const GET_DOWNLOAD_STATUS = gql`
${FULL_DOWNLOAD_STATUS}
query GET_DOWNLOAD_STATUS {
downloadStatus {
...FULL_DOWNLOAD_STATUS
}
}
`;

View File

@@ -0,0 +1,57 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_EXTENSION_FIELDS, PAGE_INFO } from '@/lib/graphql/Fragments';
// returns the current extension from the database
export const GET_EXTENSION = gql`
${FULL_EXTENSION_FIELDS}
query GET_EXTENSION($pkgName: String!) {
extension(pkgName: $pkgName) {
...FULL_EXTENSION_FIELDS
}
}
`;
// returns the current extensions from the database
export const GET_EXTENSIONS = gql`
${FULL_EXTENSION_FIELDS}
${PAGE_INFO}
query GET_EXTENSIONS(
$after: Cursor
$before: Cursor
$condition: ExtensionConditionInput
$filter: ExtensionFilterInput
$first: Int
$last: Int
$offset: Int
$orderBy: ExtensionOrderBy
$orderByType: SortOrder
) {
extensions(
after: $after
before: $before
condition: $condition
filter: $filter
first: $first
last: $last
offset: $offset
orderBy: $orderBy
orderByType: $orderByType
) {
nodes {
...FULL_EXTENSION_FIELDS
}
pageInfo {
...PAGE_INFO
}
totalCount
}
}
`;

View File

@@ -0,0 +1,55 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { GLOBAL_METADATA, PAGE_INFO } from '@/lib/graphql/Fragments.ts';
export const GET_GLOBAL_METADATA = gql`
${GLOBAL_METADATA}
query GET_GLOBAL_METADATA($key: String!) {
meta(key: $key) {
...GLOBAL_METADATA
}
}
`;
export const GET_GLOBAL_METADATAS = gql`
${GLOBAL_METADATA}
${PAGE_INFO}
query GET_GLOBAL_METADATAS(
$after: Cursor
$before: Cursor
$condition: MetaConditionInput
$filter: MetaFilterInput
$first: Int
$last: Int
$offset: Int
$orderBy: MetaOrderBy
$orderByType: SortOrder
) {
metas(
after: $after
before: $before
condition: $condition
filter: $filter
first: $first
last: $last
offset: $offset
orderBy: $orderBy
orderByType: $orderByType
) {
nodes {
...GLOBAL_METADATA
}
pageInfo {
...PAGE_INFO
}
totalCount
}
}
`;

View File

@@ -0,0 +1,59 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_CHAPTER_FIELDS, FULL_MANGA_FIELDS, PAGE_INFO } from '@/lib/graphql/Fragments';
// returns the current manga from the database
export const GET_MANGA = gql`
${FULL_MANGA_FIELDS}
${FULL_CHAPTER_FIELDS}
query GET_MANGA($id: Int!) {
manga(id: $id) {
...FULL_MANGA_FIELDS
}
}
`;
// returns the current manga from the database
export const GET_MANGAS = gql`
${FULL_MANGA_FIELDS}
${FULL_CHAPTER_FIELDS}
${PAGE_INFO}
query GET_MANGAS(
$after: Cursor
$before: Cursor
$condition: MangaConditionInput
$filter: MangaFilterInput
$first: Int
$last: Int
$offset: Int
$orderBy: MangaOrderBy
$orderByType: SortOrder
) {
mangas(
after: $after
before: $before
condition: $condition
filter: $filter
first: $first
last: $last
offset: $offset
orderBy: $orderBy
orderByType: $orderByType
) {
nodes {
...FULL_MANGA_FIELDS
}
pageInfo {
...PAGE_INFO
}
totalCount
}
}
`;

View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { WEBUI_UPDATE_INFO, WEBUI_UPDATE_STATUS } from '@/lib/graphql/Fragments';
export const GET_ABOUT = gql`
query GET_ABOUT {
about {
buildTime
buildType
discord
github
name
revision
version
}
}
`;
export const CHECK_FOR_SERVER_UPDATES = gql`
query CHECK_FOR_SERVER_UPDATES {
checkForServerUpdates {
channel
tag
url
}
}
`;
export const CHECK_FOR_WEBUI_UPDATE = gql`
${WEBUI_UPDATE_INFO}
query CHECK_FOR_WEBUI_UPDATE {
checkForWebUIUpdate {
...WEBUI_UPDATE_INFO
}
}
`;
export const GET_WEBUI_UPDATE_STATUS = gql`
${WEBUI_UPDATE_STATUS}
query GET_WEBUI_UPDATE_STATUS {
getWebUIUpdateStatus {
...WEBUI_UPDATE_STATUS
}
}
`;

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { SERVER_SETTINGS } from '@/lib/graphql/Fragments';
// eslint-disable-next-line import/prefer-default-export
export const GET_SERVER_SETTINGS = gql`
${SERVER_SETTINGS}
query GET_SERVER_SETTINGS {
settings {
...SERVER_SETTINGS
}
}
`;

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_SOURCE_FIELDS, PARTIAL_SOURCE_FIELDS } from '@/lib/graphql/Fragments';
export const GET_SOURCE = gql`
${FULL_SOURCE_FIELDS}
query GET_SOURCE($id: LongString!) {
source(id: $id) {
...FULL_SOURCE_FIELDS
}
}
`;
export const GET_SOURCES = gql`
${PARTIAL_SOURCE_FIELDS}
query GET_SOURCES {
sources {
nodes {
...PARTIAL_SOURCE_FIELDS
}
}
}
`;

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_UPDATER_STATUS } from '@/lib/graphql/Fragments';
// eslint-disable-next-line import/prefer-default-export
export const GET_UPDATE_STATUS = gql`
${FULL_UPDATER_STATUS}
query GET_UPDATE_STATUS {
updateStatus {
...FULL_UPDATER_STATUS
}
}
`;
export const GET_LAST_UPDATE_TIMESTAMP = gql`
query GET_LAST_UPDATE_TIMESTAMP {
lastUpdateTimestamp {
timestamp
}
}
`;

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
// eslint-disable-next-line import/prefer-default-export
export const DOWNLOAD_STATUS_SUBSCRIPTION = gql`
${FULL_DOWNLOAD_STATUS}
subscription DOWNLOAD_STATUS_SUBSCRIPTION {
downloadChanged {
...FULL_DOWNLOAD_STATUS
}
}
`;

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { WEBUI_UPDATE_STATUS } from '@/lib/graphql/Fragments';
// eslint-disable-next-line import/prefer-default-export
export const WEBUI_UPDATE_SUBSCRIPTION = gql`
${WEBUI_UPDATE_STATUS}
subscription WEBUI_UPDATE_SUBSCRIPTION {
webUIUpdateStatusChange {
...WEBUI_UPDATE_STATUS
}
}
`;

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { FULL_UPDATER_STATUS } from '@/lib/graphql/Fragments';
// eslint-disable-next-line import/prefer-default-export
export const UPDATER_SUBSCRIPTION = gql`
${FULL_UPDATER_STATUS}
subscription UPDATER_SUBSCRIPTION {
updateStatusChanged {
...FULL_UPDATER_STATUS
}
}
`;