fix: modified graphql files in dashboard users and teams module to match resolver changes (#50)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Joel Jacob Stephen
2023-03-22 18:19:37 +05:30
committed by GitHub
parent 3df0492275
commit 5164315243
16 changed files with 122 additions and 84 deletions

View File

@@ -10,6 +10,7 @@ export function usePagedQuery<
query: string | TypedDocumentNode<Result, Vars> | DocumentNode,
getList: (result: Result) => ListItem[],
getCursor: (value: ListItem) => string,
itemsPerPage: number,
variables: Vars
) {
//Fetch All Users
@@ -26,6 +27,7 @@ export function usePagedQuery<
const result = await client
.query(query, {
...variables,
take: itemsPerPage,
cursor:
list.value.length > 0 ? getCursor(list.value.at(-1)) : undefined,
})
@@ -33,7 +35,7 @@ export function usePagedQuery<
const resultList = getList(result.data!);
if (resultList.length < 20) {
if (resultList.length < itemsPerPage) {
hasNextPage.value = false;
}