Change order of update manga migration

This prevents issues of manga having a specific library state while they are incorrectly in or not in categories.

E.g. a manga was removed from the library but the category update mutation failed, which now causes it to still be in the set categories while not being in the library anymore
This commit is contained in:
schroda
2024-08-05 14:54:24 +02:00
parent a29c113b5f
commit 4a01b1873c
2 changed files with 13 additions and 13 deletions

View File

@@ -3057,7 +3057,7 @@ export type UpdateMangaMutationVariables = Exact<{
}>;
export type UpdateMangaMutation = { __typename?: 'Mutation', updateManga?: { __typename?: 'UpdateMangaPayload', manga: { __typename?: 'MangaType', id: number, inLibrary: boolean, inLibraryAt: string } } | null, updateMangaCategories?: { __typename?: 'UpdateMangaCategoriesPayload', manga: { __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } } } | null };
export type UpdateMangaMutation = { __typename?: 'Mutation', updateMangaCategories?: { __typename?: 'UpdateMangaCategoriesPayload', manga: { __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } } } | null, updateManga?: { __typename?: 'UpdateMangaPayload', manga: { __typename?: 'MangaType', id: number, inLibrary: boolean, inLibraryAt: string } } | null };
export type UpdateMangasMutationVariables = Exact<{
input: UpdateMangasInput;
@@ -3066,7 +3066,7 @@ export type UpdateMangasMutationVariables = Exact<{
}>;
export type UpdateMangasMutation = { __typename?: 'Mutation', updateMangas?: { __typename?: 'UpdateMangasPayload', mangas: Array<{ __typename?: 'MangaType', id: number, inLibrary: boolean, inLibraryAt: string, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } }> } | null, updateMangasCategories?: { __typename?: 'UpdateMangasCategoriesPayload', mangas: Array<{ __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } }> } | null };
export type UpdateMangasMutation = { __typename?: 'Mutation', updateMangasCategories?: { __typename?: 'UpdateMangasCategoriesPayload', mangas: Array<{ __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } }> } | null, updateMangas?: { __typename?: 'UpdateMangasPayload', mangas: Array<{ __typename?: 'MangaType', id: number, inLibrary: boolean, inLibraryAt: string, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } }> } | null };
export type UpdateMangaCategoriesMutationVariables = Exact<{
input: UpdateMangaCategoriesInput;

View File

@@ -113,13 +113,6 @@ export const UPDATE_MANGA = gql`
$updateCategoryInput: UpdateMangaCategoriesInput!
$updateCategories: Boolean!
) {
updateManga(input: $input) {
manga {
id
inLibrary
inLibraryAt
}
}
updateMangaCategories(input: $updateCategoryInput) @include(if: $updateCategories) {
manga {
id
@@ -134,6 +127,13 @@ export const UPDATE_MANGA = gql`
}
}
}
updateManga(input: $input) {
manga {
id
inLibrary
inLibraryAt
}
}
}
`;
@@ -143,11 +143,9 @@ export const UPDATE_MANGAS = gql`
$updateCategoryInput: UpdateMangasCategoriesInput!
$updateCategories: Boolean!
) {
updateMangas(input: $input) {
updateMangasCategories(input: $updateCategoryInput) @include(if: $updateCategories) {
mangas {
id
inLibrary
inLibraryAt
categories {
nodes {
id
@@ -159,9 +157,11 @@ export const UPDATE_MANGAS = gql`
}
}
}
updateMangasCategories(input: $updateCategoryInput) @include(if: $updateCategories) {
updateMangas(input: $input) {
mangas {
id
inLibrary
inLibraryAt
categories {
nodes {
id