File tree Expand file tree Collapse file tree 4 files changed +29
-10
lines changed
src/main/java/graphql/annotations/connection/simple Expand file tree Collapse file tree 4 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 11package graphql .annotations .connection .simple ;
22
3+
4+ import graphql .relay .Connection ;
5+
36import java .util .List ;
47
58/**
811 *
912 * @param <T> The type of the entities
1013 */
11- public interface SimpleConnection <T > {
14+ public interface SimpleConnection <T > extends Connection < T > {
1215
1316 /**
1417 * Get the list of the entities
@@ -22,5 +25,5 @@ public interface SimpleConnection<T> {
2225 *
2326 * @return The amount of entities
2427 */
25- long getOverAllCount ();
28+ long getTotalCount ();
2629}
Original file line number Diff line number Diff line change 11package graphql .annotations .connection .simple ;
22
3+ import graphql .relay .Connection ;
34import graphql .schema .DataFetcher ;
45import graphql .schema .DataFetchingEnvironment ;
56
@@ -29,7 +30,7 @@ public SimpleConnectionDataFetcher(Class<? extends SimpleConnectionFetcher<T>> c
2930 }
3031
3132 @ Override
32- public SimpleConnection <T > get (DataFetchingEnvironment environment ) {
33+ public Connection <T > get (DataFetchingEnvironment environment ) {
3334 SimpleConnectionFetcher <T > conn = constructNewInstance (constructor , actualDataFetcher );
3435 return conn .get (environment );
3536 }
Original file line number Diff line number Diff line change 11package graphql .annotations .connection .simple ;
22
3- import graphql .schema . DataFetcher ;
3+ import graphql .annotations . connection . ConnectionFetcher ;
44
5- public interface SimpleConnectionFetcher <T > extends DataFetcher < SimpleConnection < T > > {
5+ public interface SimpleConnectionFetcher <T > extends ConnectionFetcher < T > {
66}
Original file line number Diff line number Diff line change 11package graphql .annotations .connection .simple ;
22
3+ import graphql .relay .Edge ;
4+ import graphql .relay .PageInfo ;
5+
6+ import java .util .List ;
7+
38public class SimplePaginatedDataImpl <T > extends AbstractSimplePaginatedData <T > {
49
5- private long overAllCount ;
10+ private long totalCount ;
611
7- public SimplePaginatedDataImpl (Iterable <T > data , long overAllCount ) {
12+ public SimplePaginatedDataImpl (Iterable <T > data , long totalCount ) {
813 super (data );
9- this .overAllCount = overAllCount ;
14+ this .totalCount = totalCount ;
15+ }
16+
17+ @ Override
18+ public long getTotalCount () {
19+ return totalCount ;
20+ }
21+
22+ @ Override
23+ public List <Edge <T >> getEdges () {
24+ throw new UnsupportedOperationException ("Simple paging doesn't have edges" );
1025 }
1126
1227 @ Override
13- public long getOverAllCount () {
14- return overAllCount ;
28+ public PageInfo getPageInfo () {
29+ throw new UnsupportedOperationException ( "Simple paging doesn't have page info" ) ;
1530 }
1631}
You can’t perform that action at this time.
0 commit comments