-
-
Notifications
You must be signed in to change notification settings - Fork 723
/
IPagingHandler.cs
35 lines (31 loc) · 1.04 KB
/
IPagingHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Threading.Tasks;
using HotChocolate.Resolvers;
#nullable enable
namespace HotChocolate.Types.Pagination;
public interface IPagingHandler
{
/// <summary>
/// Will be called by the paging middleware before anything is executed and validates
/// if the current context is valid.
/// </summary>
/// <param name="context">
/// The current resolver context.
/// </param>
/// <exception cref="GraphQLException">
/// If context is not valid a <see cref="GraphQLException"/> is expected.
/// </exception>
void ValidateContext(IResolverContext context);
/// <summary>
/// Slices the <paramref name="source"/> and returns a page from it.
/// </summary>
/// <param name="context">
/// The current resolver context.
/// </param>
/// <param name="source">
/// The data set.
/// </param>
/// <returns>
/// Returns the page representing a part from the <paramref name="source"/>.
/// </returns>
ValueTask<IPage> SliceAsync(IResolverContext context, object source);
}