From f4e84412389af1332bc374856d1b44904d7b6270 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 23 Dec 2023 15:14:57 +0100 Subject: [PATCH] Prevent ApolloError handling the manga category mutation result (#510) Unclear what is causing the error or why this is fixing it, but without requesting the categories total count, the mutation fails on the first execution with "Uncaught (in promise) ApolloError: Cannot convert object to primitive value" --- src/lib/graphql/generated/graphql.ts | 4 ++-- src/lib/graphql/mutations/MangaMutation.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/graphql/generated/graphql.ts b/src/lib/graphql/generated/graphql.ts index f893e5f2..66b5afe2 100644 --- a/src/lib/graphql/generated/graphql.ts +++ b/src/lib/graphql/generated/graphql.ts @@ -2446,14 +2446,14 @@ export type UpdateMangaCategoriesMutationVariables = Exact<{ }>; -export type UpdateMangaCategoriesMutation = { __typename?: 'Mutation', updateMangaCategories: { __typename?: 'UpdateMangaCategoriesPayload', clientMutationId?: string | null, manga: { __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } } } }; +export type UpdateMangaCategoriesMutation = { __typename?: 'Mutation', updateMangaCategories: { __typename?: 'UpdateMangaCategoriesPayload', clientMutationId?: string | null, manga: { __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } } } }; export type UpdateMangasCategoriesMutationVariables = Exact<{ input: UpdateMangasCategoriesInput; }>; -export type UpdateMangasCategoriesMutation = { __typename?: 'Mutation', updateMangasCategories: { __typename?: 'UpdateMangasCategoriesPayload', clientMutationId?: string | null, mangas: Array<{ __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } }> } }; +export type UpdateMangasCategoriesMutation = { __typename?: 'Mutation', updateMangasCategories: { __typename?: 'UpdateMangasCategoriesPayload', clientMutationId?: string | null, mangas: Array<{ __typename?: 'MangaType', id: number, categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, mangas: { __typename?: 'MangaNodeList', totalCount: number } }> } }> } }; export type UpdateWebuiMutationVariables = Exact<{ input?: InputMaybe; diff --git a/src/lib/graphql/mutations/MangaMutation.ts b/src/lib/graphql/mutations/MangaMutation.ts index d1da7636..b9d1ed7c 100644 --- a/src/lib/graphql/mutations/MangaMutation.ts +++ b/src/lib/graphql/mutations/MangaMutation.ts @@ -106,6 +106,7 @@ export const UPDATE_MANGA_CATEGORIES = gql` totalCount } } + totalCount } } } @@ -125,6 +126,7 @@ export const UPDATE_MANGAS_CATEGORIES = gql` totalCount } } + totalCount } } }