Skip to content

Commit

Permalink
Expose numberOfTransfers in GTFS GraphQL API
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Nov 10, 2023
1 parent 414cfd4 commit 36df4a0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public DataFetcher<Iterable<Leg>> legs() {
return environment -> getSource(environment).getLegs();
}

@Override
public DataFetcher<Integer> numberOfTransfers() {
return environment -> getSource(environment).getNumberOfTransfers();
}

@Override
public DataFetcher<Long> startTime() {
return environment -> getSource(environment).startTime().toInstant().toEpochMilli();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ public interface GraphQLItinerary {

public DataFetcher<Iterable<Leg>> legs();

public DataFetcher<Integer> numberOfTransfers();

public DataFetcher<Long> startTime();

public DataFetcher<Iterable<SystemNotice>> systemNotices();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,13 @@ type Itinerary {
"""
accessibilityScore: Float

"""
How many transfers are contained in this itinerary.
Note: Interlined/stay-seated transfers also increase the count.
"""
numberOfTransfers: Int

#
# deprecated fields
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"emissionsPerPerson" : {
"co2" : 123.0
},
"numberOfTransfers" : 1,
"legs" : [
{
"mode" : "WALK",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
emissionsPerPerson {
co2
}
numberOfTransfers
legs {
mode
from {
Expand Down

0 comments on commit 36df4a0

Please sign in to comment.