Skip to content

Conversation

@N-Olbert
Copy link
Contributor

Summary of the changes (Less than 80 chars)

-When exposing a PageConnection the totalCount was returned as -1 when no elements were returned by the quers

Closes #8564(in this specific format)

Note: This is the most straightforward way to solve the problem, by simply adjusting the fallback value. This should be safe because the totalCount field is included in the GraphQL type only when IncludeTotalCount = true.
However, a different approach is to adjust Page<T>.Empty based on whether IncludeTotalCount = true was specified or not. That approach works too and may also be more future proof, but it is a breaking change and probably not necessary. You can find that approach here. Note that all tests are passing with both approaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TotalCount returns incorrect value -1 instead of 0

1 participant