-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathConnection.java
More file actions
29 lines (23 loc) · 897 Bytes
/
Connection.java
File metadata and controls
29 lines (23 loc) · 897 Bytes
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
package graphql.relay;
import graphql.PublicApi;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.List;
/**
* This represents a connection in Relay, which is a list of {@link graphql.relay.Edge edge}s
* as well as a {@link graphql.relay.PageInfo pageInfo} that describes the pagination of that list.
* <p>
* See <a href="https://relay.dev/graphql/connections.htm">https://relay.dev/graphql/connections.htm</a>
*/
@PublicApi
@NullMarked
public interface Connection<T> {
/**
* @return a list of {@link graphql.relay.Edge}s that contain a node of data and its cursor. Can be null as defined in the spec.
*/
@Nullable List<Edge<T>> getEdges();
/**
* @return {@link graphql.relay.PageInfo} pagination data about that list of edges. Not nullable by definition in the spec.
*/
PageInfo getPageInfo();
}