Skip to content

Commit 82416fc

Browse files
RehanSaeedjoemcbride
authored andcommitted
First Should Return DefaultPageSize (graphql-dotnet#677)
* First Should Return DefaultPageSize If the `first` and `last` properties are not set, `first` should default to the `defaultPageSize`. * Update ResolveConnectionContext.cs
1 parent d1e8367 commit 82416fc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/GraphQL/Builders/ResolveConnectionContext.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ public ResolveConnectionContext(ResolveFieldContext context, bool isUnidirection
1717
public bool IsUnidirectional { get; private set; }
1818

1919
public int? First
20+
{
21+
get
22+
{
23+
var first = FirstInternal;
24+
if (!first.HasValue && !Last.HasValue)
25+
{
26+
return _defaultPageSize;
27+
}
28+
29+
return first;
30+
}
31+
}
32+
33+
private int? FirstInternal
2034
{
2135
get
2236
{

0 commit comments

Comments
 (0)