Skip to content

Commit bdd8b8a

Browse files
committed
Make totalCount required
1 parent 63da6ba commit bdd8b8a

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.opentripplanner.framework.graphql;
22

33
import graphql.relay.Connection;
4-
import javax.annotation.Nullable;
54

65
/**
76
* This interface extends the standard GraphQL Connection interface with a method to get the total
@@ -11,6 +10,5 @@ public interface CountedConnection<T> extends Connection<T> {
1110
/**
1211
* The total number of items available in the underlying collection
1312
*/
14-
@Nullable
15-
Integer getTotalCount();
13+
int getTotalCount();
1614
}

application/src/main/java/org/opentripplanner/framework/graphql/DefaultCountedConnection.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import graphql.relay.PageInfo;
66
import java.util.List;
77
import java.util.Objects;
8-
import javax.annotation.Nullable;
98
import org.opentripplanner.utils.tostring.ToStringBuilder;
109

1110
/**
@@ -24,8 +23,7 @@ public DefaultCountedConnection(List<Edge<T>> edges, PageInfo pageInfo, Integer
2423
}
2524

2625
@Override
27-
@Nullable
28-
public Integer getTotalCount() {
26+
public int getTotalCount() {
2927
return totalCount;
3028
}
3129

application/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2706,7 +2706,7 @@ type TripOnServiceDateConnection {
27062706
pages). Note, this number might not stay the same throughout the paging as trips might be added or
27072707
removed.
27082708
"""
2709-
totalCount: Int
2709+
totalCount: Int!
27102710
}
27112711

27122712
"""

0 commit comments

Comments
 (0)