From f4c7ab4e306d2f04324853e67032d370abd65d0c Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 20 May 2022 15:37:08 +0200 Subject: chore: handle blog pagination when JS is disabled --- src/services/graphql/articles.query.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/services/graphql/articles.query.ts') diff --git a/src/services/graphql/articles.query.ts b/src/services/graphql/articles.query.ts index e02ca8e..7bd0901 100644 --- a/src/services/graphql/articles.query.ts +++ b/src/services/graphql/articles.query.ts @@ -184,3 +184,15 @@ export const totalArticlesQuery = `query PostsTotal($search: String = "") { } } }`; + +/** + * Query the end cursor based on the queried posts number. + */ +export const articlesEndCursor = `query EndCursorAfter($first: Int) { + posts(first: $first) { + pageInfo { + hasNextPage + endCursor + } + } +}`; -- cgit v1.2.3