diff --git a/src/GreenDonut/src/GreenDonut.Data.Primitives/ValueCursorPage.cs b/src/GreenDonut/src/GreenDonut.Data.Primitives/ValueCursorPage.cs
index 33e4454f6a8..4f50eeaca56 100644
--- a/src/GreenDonut/src/GreenDonut.Data.Primitives/ValueCursorPage.cs
+++ b/src/GreenDonut/src/GreenDonut.Data.Primitives/ValueCursorPage.cs
@@ -45,7 +45,7 @@ public ValueCursorPage(
///
/// An empty page.
///
- public static new ValueCursorPage Empty { get; } = new([], false, false, _ => string.Empty);
+ public static new ValueCursorPage Empty { get; } = new([], false, false, _ => string.Empty, 0);
protected override string CreateCursor(int index, int offset, int pageIndex, int totalCount)
=> _createCursor(new EdgeEntry(Entries[index].Item, offset, pageIndex, totalCount));
diff --git a/src/HotChocolate/Core/src/Types.CursorPagination.Extensions/PageConnection.cs b/src/HotChocolate/Core/src/Types.CursorPagination.Extensions/PageConnection.cs
index 17b074eb0d2..71187812842 100644
--- a/src/HotChocolate/Core/src/Types.CursorPagination.Extensions/PageConnection.cs
+++ b/src/HotChocolate/Core/src/Types.CursorPagination.Extensions/PageConnection.cs
@@ -76,5 +76,6 @@ public override IReadOnlyList>? Edges
/// Identifies the total count of items in the connection.
///
[GraphQLDescription("Identifies the total count of items in the connection.")]
- public int TotalCount => _page.TotalCount ?? -1;
+ public int TotalCount =>
+ _page.TotalCount ?? throw new GraphQLException("Total count is not available for this connection.");
}