graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Incorrect hasNextPage value when using DbContextCursorPagingProvider

Open drebouta opened this issue 2 years ago • 1 comments

Product

Hot Chocolate

Version

14.0.0-rc.2

Link to minimal reproduction

https://github.com/CronKz/HC.HasNextPageIssue

Steps to reproduce

  1. Build and run the poject using dotnet run
  2. Run this query: query Test { books(first: 10) { pageInfo { hasNextPage } nodes { id title } } }
  3. hasNextPage returns false, but it should be true

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

drebouta avatar Sep 24 '24 08:09 drebouta

Currently working on a PR

drebouta avatar Sep 25 '24 08:09 drebouta