Update graphql files structure

This commit is contained in:
schroda
2025-12-22 14:00:44 +01:00
parent 14a881f17f
commit 083586c567
71 changed files with 544 additions and 550 deletions

View File

@@ -0,0 +1,43 @@
/*
* 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 ABOUT_WEBUI = gql`
fragment ABOUT_WEBUI on AboutWebUI {
channel
tag
updateTimestamp
}
`;
export const WEBUI_UPDATE_CHECK = gql`
fragment WEBUI_UPDATE_CHECK on WebUIUpdateCheck {
channel
tag
updateAvailable
}
`;
export const WEBUI_UPDATE_INFO = gql`
fragment WEBUI_UPDATE_INFO on WebUIUpdateInfo {
channel
tag
}
`;
export const WEBUI_UPDATE_STATUS = gql`
${WEBUI_UPDATE_INFO}
fragment WEBUI_UPDATE_STATUS on WebUIUpdateStatus {
info {
...WEBUI_UPDATE_INFO
}
progress
state
}
`;

View File

@@ -0,0 +1,33 @@
/*
* 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/server/InfoFragments.ts';
export const UPDATE_WEBUI = gql`
${WEBUI_UPDATE_STATUS}
mutation UPDATE_WEBUI($input: WebUIUpdateInput = {}) {
updateWebUI(input: $input) {
updateStatus {
...WEBUI_UPDATE_STATUS
}
}
}
`;
export const RESET_WEBUI_UPDATE_STATUS = gql`
${WEBUI_UPDATE_INFO}
mutation RESET_WEBUI_UPDATE_STATUS {
resetWebUIUpdateStatus {
info {
...WEBUI_UPDATE_INFO
}
state
}
}
`;

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 { ABOUT_WEBUI, WEBUI_UPDATE_CHECK, WEBUI_UPDATE_STATUS } from '@/lib/graphql/server/InfoFragments.ts';
export const GET_ABOUT = gql`
${ABOUT_WEBUI}
query GET_ABOUT {
aboutServer {
buildTime
buildType
discord
github
name
version
}
aboutWebUI {
...ABOUT_WEBUI
}
}
`;
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_CHECK}
query CHECK_FOR_WEBUI_UPDATE {
checkForWebUIUpdate {
...WEBUI_UPDATE_CHECK
}
}
`;
export const GET_WEBUI_UPDATE_STATUS = gql`
${WEBUI_UPDATE_STATUS}
query GET_WEBUI_UPDATE_STATUS {
getWebUIUpdateStatus {
...WEBUI_UPDATE_STATUS
}
}
`;

View File

@@ -0,0 +1,19 @@
/*
* 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/server/InfoFragments.ts';
export const WEBUI_UPDATE_SUBSCRIPTION = gql`
${WEBUI_UPDATE_STATUS}
subscription WEBUI_UPDATE_SUBSCRIPTION {
webUIUpdateStatusChange {
...WEBUI_UPDATE_STATUS
}
}
`;