-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create queries, mutations and subscriptions
- Loading branch information
Showing
26 changed files
with
1,675 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,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 | ||
} | ||
} | ||
} | ||
`; |
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,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 | ||
} | ||
} | ||
} | ||
`; |
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,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 | ||
} | ||
} | ||
} | ||
`; |
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,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 | ||
} | ||
} | ||
} | ||
`; |
Oops, something went wrong.