From cee566d9b294d6499e938488fadb497c5dbc2b3f Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:55:49 +0100 Subject: [PATCH] [Codegen] Update manga chapter total count on initial refresh (#582) In case a manga hadn't been initialized yet, its chapter total count was still 0 after refreshing the manga and its chapter list data. This was caused because its chapter list hadn't been fetched yet by the time the manga refresh mutation resolved. --- src/lib/graphql/generated/graphql.ts | 2 +- src/lib/graphql/mutations/ChapterMutation.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/graphql/generated/graphql.ts b/src/lib/graphql/generated/graphql.ts index 683f4ed6..a5a77dac 100644 --- a/src/lib/graphql/generated/graphql.ts +++ b/src/lib/graphql/generated/graphql.ts @@ -2594,7 +2594,7 @@ export type GetMangaChaptersFetchMutationVariables = Exact<{ }>; -export type GetMangaChaptersFetchMutation = { __typename?: 'Mutation', fetchChapters: { __typename?: 'FetchChaptersPayload', clientMutationId?: string | null, chapters: Array<{ __typename?: 'ChapterType', chapterNumber: number, fetchedAt: any, id: number, isBookmarked: boolean, isDownloaded: boolean, isRead: boolean, lastPageRead: number, lastReadAt: any, name: string, pageCount: number, realUrl?: string | null, scanlator?: string | null, sourceOrder: number, uploadDate: any, url: string, manga: { __typename?: 'MangaType', id: number, title: string, inLibrary: boolean, thumbnailUrl?: string | null }, meta: Array<{ __typename?: 'ChapterMetaType', key: string, value: string }> }> } }; +export type GetMangaChaptersFetchMutation = { __typename?: 'Mutation', fetchChapters: { __typename?: 'FetchChaptersPayload', clientMutationId?: string | null, chapters: Array<{ __typename?: 'ChapterType', chapterNumber: number, fetchedAt: any, id: number, isBookmarked: boolean, isDownloaded: boolean, isRead: boolean, lastPageRead: number, lastReadAt: any, name: string, pageCount: number, realUrl?: string | null, scanlator?: string | null, sourceOrder: number, uploadDate: any, url: string, manga: { __typename?: 'MangaType', id: number, title: string, inLibrary: boolean, thumbnailUrl?: string | null, chapters: { __typename?: 'ChapterNodeList', totalCount: number } }, meta: Array<{ __typename?: 'ChapterMetaType', key: string, value: string }> }> } }; export type SetChapterMetadataMutationVariables = Exact<{ input: SetChapterMetaInput; diff --git a/src/lib/graphql/mutations/ChapterMutation.ts b/src/lib/graphql/mutations/ChapterMutation.ts index a82a2939..cc46bd4f 100644 --- a/src/lib/graphql/mutations/ChapterMutation.ts +++ b/src/lib/graphql/mutations/ChapterMutation.ts @@ -57,6 +57,12 @@ export const GET_MANGA_CHAPTERS_FETCH = gql` clientMutationId chapters { ...FULL_CHAPTER_FIELDS + manga { + id + chapters { + totalCount + } + } } } }