Commit 7eab3af0 authored by Volker Krause's avatar Volker Krause
Browse files

Adapt stopover GraphQL query for OTP2

Also, take the maximum result hint into account for this.
parent 8103acf9
Pipeline #64322 passed with stage
in 25 seconds
......@@ -111,6 +111,7 @@ bool OpenTripPlannerGraphQLBackend::queryStopover(const StopoverRequest &req, St
}
gqlReq.setVariable(QStringLiteral("startTime"), dt.toSecsSinceEpoch());
gqlReq.setVariable(QStringLiteral("startDateTime"), dt.toString(Qt::ISODate));
gqlReq.setVariable(QStringLiteral("maxResults"), req.maximumResults());
// TODO arrival/departure selection?
if (isLoggingEnabled()) {
......
......@@ -18,6 +18,7 @@
<file>entur/stationByCoordinate.graphql</file>
<file>entur/stationByName.graphql</file>
<file>otp2/departure.graphql</file>
<file>otp2/journey.graphql</file>
<file>otp2/stationByCoordinate.graphql</file>
<file>otp2/stationByName.graphql</file>
......
# SPDX-FileCopyrightText: 2020-2021 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: CC0-1.0
query departures(
$lat: Float!,
$lon: Float!,
$startTime: Long!,
$maxResults: Int!
) {
nearest(lat: $lat, lon: $lon, maxDistance: 500, filterByPlaceTypes: DEPARTURE_ROW) {
edges {
node {
place {
...on DepartureRow {
stop {
id: gtfsId
name
lat
lon
parentStation {
id: gtfsId
name
lat
lon
}
}
stoptimes(startTime: $startTime, numberOfDepartures: $maxResults, omitCanceled: false) {
stop {
platformCode
}
serviceDay
scheduledArrival
realtimeArrival
scheduledDeparture
realtimeDeparture
realtime
trip {
tripHeadsign
route {
type
desc
shortName
longName
color
textColor
#bikesAllowed
alerts {
alertHeaderTextTranslations {
language
text
}
alertDescriptionTextTranslations {
language
text
}
alertEffect
alertCause
alertSeverityLevel
}
}
}
}
}
}
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment