Fix/add manga to library without dialog not adding default categories (#632)

* Add default categories when adding manga to library without dialog

* Add manga to library and update categories in one mutation
This commit is contained in:
schroda
2024-03-02 15:26:15 +01:00
committed by GitHub
parent eb233aef3d
commit c5a5c4b8af
6 changed files with 40 additions and 15 deletions

View File

@@ -2833,10 +2833,12 @@ export type SetMangaMetadataMutation = { __typename?: 'Mutation', setMangaMeta:
export type UpdateMangaMutationVariables = Exact<{
input: UpdateMangaInput;
updateCategoryInput: UpdateMangaCategoriesInput;
updateCategories: Scalars['Boolean']['input'];
}>;
export type UpdateMangaMutation = { __typename?: 'Mutation', updateManga: { __typename?: 'UpdateMangaPayload', clientMutationId?: string | null, manga: { __typename?: 'MangaType', id: number, inLibrary: boolean, inLibraryAt: any, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } } } };
export type UpdateMangaMutation = { __typename?: 'Mutation', updateManga: { __typename?: 'UpdateMangaPayload', clientMutationId?: string | null, manga: { __typename?: 'MangaType', id: number, inLibrary: boolean, inLibraryAt: any } }, updateMangaCategories?: { __typename?: 'UpdateMangaCategoriesPayload', manga: { __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } } } };
export type UpdateMangasMutationVariables = Exact<{
input: UpdateMangasInput;

View File

@@ -99,13 +99,22 @@ export const SET_MANGA_METADATA = gql`
`;
export const UPDATE_MANGA = gql`
mutation UPDATE_MANGA($input: UpdateMangaInput!) {
mutation UPDATE_MANGA(
$input: UpdateMangaInput!
$updateCategoryInput: UpdateMangaCategoriesInput!
$updateCategories: Boolean!
) {
updateManga(input: $input) {
clientMutationId
manga {
id
inLibrary
inLibraryAt
}
}
updateMangaCategories(input: $updateCategoryInput) @include(if: $updateCategories) {
manga {
id
categories {
nodes {
id