Reduce requested downloader data in queries
This commit is contained in:
@@ -185,28 +185,6 @@ export const FULL_EXTENSION_FIELDS = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const FULL_DOWNLOAD_STATUS = gql`
|
||||
fragment FULL_DOWNLOAD_STATUS on DownloadStatus {
|
||||
queue {
|
||||
chapter {
|
||||
id
|
||||
name
|
||||
sourceOrder
|
||||
isDownloaded
|
||||
manga {
|
||||
id
|
||||
title
|
||||
downloadCount
|
||||
}
|
||||
}
|
||||
progress
|
||||
state
|
||||
tries
|
||||
}
|
||||
state
|
||||
}
|
||||
`;
|
||||
|
||||
export const ABOUT_WEBUI = gql`
|
||||
fragment ABOUT_WEBUI on AboutWebUI {
|
||||
channel
|
||||
|
||||
34
src/lib/graphql/fragments/DownloadFragments.ts
Normal file
34
src/lib/graphql/fragments/DownloadFragments.ts
Normal 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';
|
||||
|
||||
export const DOWNLOAD_STATUS_FIELDS = gql`
|
||||
fragment DOWNLOAD_STATUS_FIELDS on DownloadStatus {
|
||||
state
|
||||
|
||||
queue {
|
||||
chapter {
|
||||
id
|
||||
name
|
||||
sourceOrder
|
||||
isDownloaded
|
||||
}
|
||||
|
||||
manga {
|
||||
id
|
||||
title
|
||||
downloadCount
|
||||
}
|
||||
|
||||
progress
|
||||
state
|
||||
tries
|
||||
}
|
||||
}
|
||||
`;
|
||||
File diff suppressed because one or more lines are too long
@@ -7,15 +7,16 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
|
||||
import { DOWNLOAD_STATUS_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
|
||||
export const CLEAR_DOWNLOADER = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation CLEAR_DOWNLOADER($input: ClearDownloaderInput = {}) {
|
||||
clearDownloader(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,60 +55,65 @@ export const DELETE_DOWNLOADED_CHAPTERS = gql`
|
||||
`;
|
||||
|
||||
export const DEQUEUE_CHAPTER_DOWNLOAD = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation DEQUEUE_CHAPTER_DOWNLOAD($input: DequeueChapterDownloadInput!) {
|
||||
dequeueChapterDownload(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DEQUEUE_CHAPTER_DOWNLOADS = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation DEQUEUE_CHAPTER_DOWNLOADS($input: DequeueChapterDownloadsInput!) {
|
||||
dequeueChapterDownloads(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const ENQUEUE_CHAPTER_DOWNLOAD = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation ENQUEUE_CHAPTER_DOWNLOAD($input: EnqueueChapterDownloadInput!) {
|
||||
enqueueChapterDownload(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const ENQUEUE_CHAPTER_DOWNLOADS = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation ENQUEUE_CHAPTER_DOWNLOADS($input: EnqueueChapterDownloadsInput!) {
|
||||
enqueueChapterDownloads(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const REORDER_CHAPTER_DOWNLOAD = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation REORDER_CHAPTER_DOWNLOAD($input: ReorderChapterDownloadInput!) {
|
||||
reorderChapterDownload(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
|
||||
import { DOWNLOAD_STATUS_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
|
||||
export const GET_DOWNLOAD_STATUS = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
query GET_DOWNLOAD_STATUS {
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
|
||||
import { DOWNLOAD_STATUS_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
|
||||
export const DOWNLOAD_STATUS_SUBSCRIPTION = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
subscription DOWNLOAD_STATUS_SUBSCRIPTION {
|
||||
downloadChanged {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user