graphql-platform
graphql-platform copied to clipboard
Incorrect hasNextPage value when using DbContextCursorPagingProvider
Product
Hot Chocolate
Version
14.0.0-rc.2
Link to minimal reproduction
https://github.com/CronKz/HC.HasNextPageIssue
Steps to reproduce
- Build and run the poject using
dotnet run - Run this query:
query Test { books(first: 10) { pageInfo { hasNextPage } nodes { id title } } } - hasNextPage returns
false, but it should betrue
When using offset pagination the same query returns true (Remove .AddDbContextCursorPagingProvider() in Program.cs).
What is expected?
hasNextPage should return true
What is actually happening?
hasNextPage returns false
Relevant log output
Executed DbCommand (15ms) [Parameters=[@__p_0='11'], CommandType='Text', CommandTimeout='30']
SELECT TOP(@__p_0) [b].[Id], [b].[Title]
FROM [Book] AS [b]
ORDER BY [b].[Id]
Additional context
Implementation is based on this blogpost https://chillicream.com/blog/2024/08/30/hot-chocolate-14
Currently working on a PR