Reduce requested source data in queries
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { SOURCE_BASE_FIELDS } from '@/lib/graphql/fragments/SourceFragments.ts';
|
||||
|
||||
export const PAGE_INFO = gql`
|
||||
fragment PAGE_INFO on PageInfo {
|
||||
@@ -51,169 +52,6 @@ export const UPDATER_CATEGORY_FIELDS = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const PARTIAL_SOURCE_FIELDS = gql`
|
||||
fragment PARTIAL_SOURCE_FIELDS on SourceType {
|
||||
displayName
|
||||
iconUrl
|
||||
id
|
||||
isConfigurable
|
||||
isNsfw
|
||||
lang
|
||||
name
|
||||
supportsLatest
|
||||
extension {
|
||||
pkgName
|
||||
repo
|
||||
}
|
||||
meta {
|
||||
key
|
||||
value
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
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 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
|
||||
SortFilterDefault: default {
|
||||
ascending
|
||||
index
|
||||
}
|
||||
name
|
||||
values
|
||||
}
|
||||
... on SeparatorFilter {
|
||||
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
|
||||
SortFilterDefault: default {
|
||||
ascending
|
||||
index
|
||||
}
|
||||
name
|
||||
values
|
||||
}
|
||||
... on SeparatorFilter {
|
||||
type: __typename
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const FULL_TRACKER_FIELDS = gql`
|
||||
fragment FULL_TRACKER_FIELDS on TrackerType {
|
||||
id
|
||||
@@ -266,7 +104,7 @@ export const FULL_TRACK_RECORD_FIELDS = gql`
|
||||
`;
|
||||
|
||||
export const BASE_MANGA_FIELDS = gql`
|
||||
${PARTIAL_SOURCE_FIELDS}
|
||||
${SOURCE_BASE_FIELDS}
|
||||
${FULL_TRACK_RECORD_FIELDS}
|
||||
fragment BASE_MANGA_FIELDS on MangaType {
|
||||
artist
|
||||
@@ -285,7 +123,7 @@ export const BASE_MANGA_FIELDS = gql`
|
||||
}
|
||||
realUrl
|
||||
source {
|
||||
...PARTIAL_SOURCE_FIELDS
|
||||
...SOURCE_BASE_FIELDS
|
||||
}
|
||||
status
|
||||
thumbnailUrl
|
||||
@@ -304,7 +142,6 @@ export const BASE_MANGA_FIELDS = gql`
|
||||
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
|
||||
|
||||
207
src/lib/graphql/fragments/SourceFragments.ts
Normal file
207
src/lib/graphql/fragments/SourceFragments.ts
Normal file
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
* 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 SOURCE_BASE_FIELDS = gql`
|
||||
fragment SOURCE_BASE_FIELDS on SourceType {
|
||||
id
|
||||
name
|
||||
displayName
|
||||
}
|
||||
`;
|
||||
|
||||
export const SOURCE_MIGRATABLE_FIELDS = gql`
|
||||
${SOURCE_BASE_FIELDS}
|
||||
|
||||
fragment SOURCE_MIGRATABLE_FIELDS on SourceType {
|
||||
...SOURCE_BASE_FIELDS
|
||||
|
||||
lang
|
||||
iconUrl
|
||||
}
|
||||
`;
|
||||
|
||||
export const SOURCE_LIST_FIELDS = gql`
|
||||
${SOURCE_BASE_FIELDS}
|
||||
|
||||
fragment SOURCE_LIST_FIELDS on SourceType {
|
||||
...SOURCE_BASE_FIELDS
|
||||
|
||||
lang
|
||||
iconUrl
|
||||
isNsfw
|
||||
supportsLatest
|
||||
|
||||
extension {
|
||||
pkgName
|
||||
repo
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SOURCE_BROWSE_FIELDS = gql`
|
||||
${SOURCE_BASE_FIELDS}
|
||||
|
||||
fragment SOURCE_BROWSE_FIELDS on SourceType {
|
||||
...SOURCE_BASE_FIELDS
|
||||
|
||||
isConfigurable
|
||||
supportsLatest
|
||||
|
||||
meta {
|
||||
key
|
||||
value
|
||||
}
|
||||
|
||||
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
|
||||
SortFilterDefault: default {
|
||||
ascending
|
||||
index
|
||||
}
|
||||
name
|
||||
values
|
||||
}
|
||||
... on SeparatorFilter {
|
||||
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
|
||||
SortFilterDefault: default {
|
||||
ascending
|
||||
index
|
||||
}
|
||||
name
|
||||
values
|
||||
}
|
||||
... on SeparatorFilter {
|
||||
type: __typename
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SOURCE_SETTING_FIELDS = gql`
|
||||
${SOURCE_BASE_FIELDS}
|
||||
|
||||
fragment SOURCE_SETTING_FIELDS on SourceType {
|
||||
...SOURCE_BASE_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
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -1,7 +1,7 @@
|
||||
import {FieldPolicy, FieldReadFunction, Reference, TypePolicies, TypePolicy} from '@apollo/client/cache';
|
||||
import {
|
||||
GetChaptersMangaQuery, GetDownloadStatusQueryVariables, GetExtensionQueryVariables, GetGlobalMetadataQueryVariables,
|
||||
GetMangaQueryVariables, GetSourceQueryVariables, GetUpdateStatusQueryVariables, GetWebuiUpdateStatusQueryVariables,
|
||||
GetMangaQueryVariables, GetSourceBrowseQueryVariables, GetUpdateStatusQueryVariables, GetWebuiUpdateStatusQueryVariables,
|
||||
} from "@/lib/graphql/generated/graphql.ts";
|
||||
import {FieldFunctionOptions} from "@apollo/client/cache/inmemory/policies";
|
||||
export type AboutServerPayloadKeySpecifier = ('buildTime' | 'buildType' | 'discord' | 'github' | 'name' | 'revision' | 'version' | AboutServerPayloadKeySpecifier)[];
|
||||
@@ -590,7 +590,7 @@ export type QueryFieldPolicy = {
|
||||
restoreStatus?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
searchTracker?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
settings?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
source?: FieldPolicy<Reference, Reference, Reference, FieldFunctionOptions<GetSourceQueryVariables>> | FieldReadFunction<Reference, Reference, FieldFunctionOptions<GetSourceQueryVariables>>,
|
||||
source?: FieldPolicy<Reference, Reference, Reference, FieldFunctionOptions<GetSourceBrowseQueryVariables>> | FieldReadFunction<Reference, Reference, FieldFunctionOptions<GetSourceBrowseQueryVariables>>,
|
||||
sources?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
trackRecord?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
trackRecords?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -8,6 +8,7 @@
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { BASE_MANGA_FIELDS } from '@/lib/graphql/Fragments';
|
||||
import { SOURCE_SETTING_FIELDS } from '@/lib/graphql/fragments/SourceFragments.ts';
|
||||
|
||||
export const GET_SOURCE_MANGAS_FETCH = gql`
|
||||
${BASE_MANGA_FIELDS}
|
||||
@@ -23,62 +24,13 @@ export const GET_SOURCE_MANGAS_FETCH = gql`
|
||||
`;
|
||||
|
||||
export const UPDATE_SOURCE_PREFERENCES = gql`
|
||||
${SOURCE_SETTING_FIELDS}
|
||||
|
||||
mutation UPDATE_SOURCE_PREFERENCES($input: UpdateSourcePreferenceInput!) {
|
||||
updateSourcePreference(input: $input) {
|
||||
clientMutationId
|
||||
source {
|
||||
id
|
||||
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
|
||||
}
|
||||
}
|
||||
...SOURCE_SETTING_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,38 +7,64 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { FULL_SOURCE_FIELDS, PARTIAL_SOURCE_FIELDS } from '@/lib/graphql/Fragments';
|
||||
import {
|
||||
SOURCE_BROWSE_FIELDS,
|
||||
SOURCE_LIST_FIELDS,
|
||||
SOURCE_MIGRATABLE_FIELDS,
|
||||
SOURCE_SETTING_FIELDS,
|
||||
} from '@/lib/graphql/fragments/SourceFragments.ts';
|
||||
|
||||
export const GET_SOURCE = gql`
|
||||
${FULL_SOURCE_FIELDS}
|
||||
query GET_SOURCE($id: LongString!) {
|
||||
export const GET_SOURCE_BROWSE = gql`
|
||||
${SOURCE_BROWSE_FIELDS}
|
||||
|
||||
query GET_SOURCE_BROWSE($id: LongString!) {
|
||||
source(id: $id) {
|
||||
...FULL_SOURCE_FIELDS
|
||||
...SOURCE_BROWSE_FIELDS
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_SOURCES = gql`
|
||||
${PARTIAL_SOURCE_FIELDS}
|
||||
query GET_SOURCES {
|
||||
export const GET_SOURCE_SETTINGS = gql`
|
||||
${SOURCE_SETTING_FIELDS}
|
||||
|
||||
query GET_SOURCE_SETTINGS($id: LongString!) {
|
||||
source(id: $id) {
|
||||
...SOURCE_SETTING_FIELDS
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_SOURCE_MIGRATABLE = gql`
|
||||
${SOURCE_MIGRATABLE_FIELDS}
|
||||
|
||||
query GET_SOURCE_MIGRATABLE($id: LongString!) {
|
||||
source(id: $id) {
|
||||
...SOURCE_MIGRATABLE_FIELDS
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_SOURCES_LIST = gql`
|
||||
${SOURCE_LIST_FIELDS}
|
||||
|
||||
query GET_SOURCES_LIST {
|
||||
sources {
|
||||
nodes {
|
||||
...PARTIAL_SOURCE_FIELDS
|
||||
...SOURCE_LIST_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_MIGRATABLE_SOURCES = gql`
|
||||
${SOURCE_MIGRATABLE_FIELDS}
|
||||
|
||||
query GET_MIGRATABLE_SOURCES {
|
||||
mangas(condition: { inLibrary: true }) {
|
||||
nodes {
|
||||
sourceId
|
||||
source {
|
||||
id
|
||||
name
|
||||
lang
|
||||
iconUrl
|
||||
...SOURCE_MIGRATABLE_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,9 @@ import {
|
||||
MetadataHolder,
|
||||
MetadataKeyValuePair,
|
||||
TManga,
|
||||
TPartialSource,
|
||||
} from '@/typings.ts';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MetaType, SourceType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { DEFAULT_DEVICE, getActiveDevice } from '@/util/device.ts';
|
||||
import { CategoryIdInfo } from '@/lib/data/Categories.ts';
|
||||
import { ChapterIdInfo } from '@/lib/data/Chapters.ts';
|
||||
@@ -382,7 +381,8 @@ export const requestUpdateMetadataValue = async (
|
||||
await requestManager.setMangaMeta((metadataHolder as TManga).id, metadataKey, value).response;
|
||||
break;
|
||||
case 'source':
|
||||
await requestManager.setSourceMeta((metadataHolder as TPartialSource).id, metadataKey, value).response;
|
||||
await requestManager.setSourceMeta((metadataHolder as Pick<SourceType, 'id'>).id, metadataKey, value)
|
||||
.response;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`requestUpdateMetadataValue: unknown holderType "${holderType}"`);
|
||||
@@ -415,6 +415,6 @@ export const requestUpdateCategoryMetadata = async (
|
||||
): Promise<void[]> => requestUpdateMetadata(category, 'category', keysToValues);
|
||||
|
||||
export const requestUpdateSourceMetadata = async (
|
||||
source: TPartialSource,
|
||||
source: Pick<SourceType, 'id'> & GqlMetaHolder,
|
||||
keysToValue: MetadataKeyValuePair[],
|
||||
): Promise<void[]> => requestUpdateMetadata(source, 'source', keysToValue);
|
||||
|
||||
@@ -13,11 +13,11 @@ import {
|
||||
ISourceMetadata,
|
||||
Metadata,
|
||||
SourceMetadataKeys,
|
||||
TPartialSource,
|
||||
} from '@/typings.ts';
|
||||
import { jsonSaveParse } from '@/util/HelperFunctions.ts';
|
||||
import { convertFromGqlMeta, getMetadataFrom, requestUpdateSourceMetadata } from '@/lib/metadata/metadata.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
||||
import { SourceType } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
const convertAppMetadataToGqlMetadata = (
|
||||
metadata: Partial<ISourceMetadata>,
|
||||
@@ -42,7 +42,7 @@ export const updateSourceMetadata = async <
|
||||
MetadataKeys extends SourceMetadataKeys = SourceMetadataKeys,
|
||||
MetadataKey extends MetadataKeys = MetadataKeys,
|
||||
>(
|
||||
source: TPartialSource,
|
||||
source: Pick<SourceType, 'id'> & GqlMetaHolder,
|
||||
metadataKey: MetadataKey,
|
||||
value: ISourceMetadata[MetadataKey],
|
||||
): Promise<void[]> =>
|
||||
@@ -52,7 +52,7 @@ export const updateSourceMetadata = async <
|
||||
|
||||
export const createUpdateSourceMetadata =
|
||||
<Settings extends SourceMetadataKeys>(
|
||||
source: TPartialSource,
|
||||
source: Pick<SourceType, 'id'> & GqlMetaHolder,
|
||||
handleError: (error: any) => void = defaultPromiseErrorHandler('createUpdateSourceMetadata'),
|
||||
): ((...args: OmitFirst<Parameters<typeof updateSourceMetadata<Settings>>>) => Promise<void | void[]>) =>
|
||||
(metadataKey, value) =>
|
||||
|
||||
@@ -90,10 +90,6 @@ import {
|
||||
GetServerSettingsQuery,
|
||||
GetSourceMangasFetchMutation,
|
||||
GetSourceMangasFetchMutationVariables,
|
||||
GetSourceQuery,
|
||||
GetSourceQueryVariables,
|
||||
GetSourcesQuery,
|
||||
GetSourcesQueryVariables,
|
||||
GetUpdateStatusQuery,
|
||||
GetUpdateStatusQueryVariables,
|
||||
InstallExternalExtensionMutation,
|
||||
@@ -201,6 +197,8 @@ import {
|
||||
GetChaptersMangaQueryVariables,
|
||||
GetChaptersUpdatesQuery,
|
||||
GetChaptersUpdatesQueryVariables,
|
||||
GetSourcesListQuery,
|
||||
GetSourcesListQueryVariables,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_GLOBAL_METADATAS } from '@/lib/graphql/queries/GlobalMetadataQuery.ts';
|
||||
import { SET_GLOBAL_METADATA } from '@/lib/graphql/mutations/GlobalMetadataMutation.ts';
|
||||
@@ -216,7 +214,7 @@ import {
|
||||
INSTALL_EXTERNAL_EXTENSION,
|
||||
UPDATE_EXTENSION,
|
||||
} from '@/lib/graphql/mutations/ExtensionMutation.ts';
|
||||
import { GET_MIGRATABLE_SOURCES, GET_SOURCE, GET_SOURCES } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import { GET_MIGRATABLE_SOURCES, GET_SOURCES_LIST } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import {
|
||||
GET_MANGA_FETCH,
|
||||
GET_MANGA_TO_MIGRATE_TO_FETCH,
|
||||
@@ -1352,16 +1350,17 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public useGetSourceList(
|
||||
options?: QueryHookOptions<GetSourcesQuery, GetSourcesQueryVariables>,
|
||||
): AbortableApolloUseQueryResponse<GetSourcesQuery, GetSourcesQueryVariables> {
|
||||
return this.doRequest(GQLMethod.USE_QUERY, GET_SOURCES, {}, options);
|
||||
options?: QueryHookOptions<GetSourcesListQuery, GetSourcesListQueryVariables>,
|
||||
): AbortableApolloUseQueryResponse<GetSourcesListQuery, GetSourcesListQueryVariables> {
|
||||
return this.doRequest(GQLMethod.USE_QUERY, GET_SOURCES_LIST, {}, options);
|
||||
}
|
||||
|
||||
public useGetSource(
|
||||
public useGetSource<Data, Variables extends OperationVariables>(
|
||||
document: DocumentNode | TypedDocumentNode<Data, Variables>,
|
||||
id: string,
|
||||
options?: QueryHookOptions<GetSourceQuery, GetSourceQueryVariables>,
|
||||
): AbortableApolloUseQueryResponse<GetSourceQuery, GetSourceQueryVariables> {
|
||||
return this.doRequest(GQLMethod.USE_QUERY, GET_SOURCE, { id }, options);
|
||||
options?: QueryHookOptions<Data, Variables>,
|
||||
): AbortableApolloUseQueryResponse<Data, Variables> {
|
||||
return this.doRequest(GQLMethod.USE_QUERY, document, { id } as unknown as Variables, options);
|
||||
}
|
||||
|
||||
public setSourceMeta(
|
||||
|
||||
Reference in New Issue
Block a user