Skip to content

Commit

Permalink
[Codegen] Update manga chapter total count on initial refresh (#582)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schroda authored Jan 29, 2024
1 parent c483e71 commit cee566d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/graphql/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/lib/graphql/mutations/ChapterMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export const GET_MANGA_CHAPTERS_FETCH = gql`
clientMutationId
chapters {
...FULL_CHAPTER_FIELDS
manga {
id
chapters {
totalCount
}
}
}
}
}
Expand Down

0 comments on commit cee566d

Please sign in to comment.