Use gql for "fetchMore" workaround

The "loading" and "networkStatus" state do not get correctly updated when e.g. calling "fetchMore".
This seems to happen because an abort signal is passed on every hook call.
Due to passing this signal, the passed args to the hook change, and thus, it looks like apollo considers this a completely new hook call.
By preventing the signal from being passed, the hook correctly updates these states, but, on the contrary, it is not possible to abort these requests anymore
This commit is contained in:
schroda
2023-10-02 16:58:32 +02:00
parent aad87463f3
commit e2f34f1f47
2 changed files with 42 additions and 10 deletions

View File

@@ -113,6 +113,7 @@ const Updates: React.FC = () => {
} = requestManager.useGetRecentlyUpdatedChapters(undefined, {
fetchPolicy: 'cache-and-network',
notifyOnNetworkStatusChange: true,
omitAbortSignal: true,
});
const hasNextPage = !!chapterUpdateData?.chapters.pageInfo.hasNextPage;
const endCursor = chapterUpdateData?.chapters.pageInfo.endCursor;