diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java index 9e9d78445f3..221df2b8ec6 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java @@ -56,6 +56,7 @@ import org.opentripplanner.routing.graphfinder.PatternAtStop; import org.opentripplanner.routing.graphfinder.PlaceAtDistance; import org.opentripplanner.routing.graphfinder.PlaceType; +import org.opentripplanner.routing.services.TransitAlertService; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.service.vehiclerental.VehicleRentalService; @@ -394,7 +395,7 @@ public DataFetcher node() { case "Agency": return transitService.getAgencyForId(FeedScopedId.parse(id)); case "Alert": - return null; //TODO + return transitService.getTransitAlertService().getAlertById(FeedScopedId.parse(id)); case "BikePark": var bikeParkId = FeedScopedId.parse(id); return vehicleParkingService == null diff --git a/application/src/test/resources/org/opentripplanner/apis/gtfs/expectations/node-alert.json b/application/src/test/resources/org/opentripplanner/apis/gtfs/expectations/node-alert.json new file mode 100644 index 00000000000..8d4c96fb4a9 --- /dev/null +++ b/application/src/test/resources/org/opentripplanner/apis/gtfs/expectations/node-alert.json @@ -0,0 +1,10 @@ +{ + "data": { + "node": { + "id": "QWxlcnQ6Rjpuby1oZWFkZXI", + "alertHeaderText": "Second string", + "alertDescriptionText": "Second string", + "alertUrl": null + } + } +} \ No newline at end of file diff --git a/application/src/test/resources/org/opentripplanner/apis/gtfs/queries/node-alert.graphql b/application/src/test/resources/org/opentripplanner/apis/gtfs/queries/node-alert.graphql new file mode 100644 index 00000000000..533595e0d5f --- /dev/null +++ b/application/src/test/resources/org/opentripplanner/apis/gtfs/queries/node-alert.graphql @@ -0,0 +1,10 @@ +{ + node(id: "QWxlcnQ6Rjpuby1oZWFkZXI") { + id + ... on Alert { + alertHeaderText + alertDescriptionText + alertUrl + } + } +}