Commit d51436b6 authored by Volker Krause's avatar Volker Krause
Browse files

Only request intermediate stops and paths from OTP2 when needed

parent d3b59bd2
......@@ -162,6 +162,8 @@ bool OpenTripPlannerGraphQLBackend::queryJourney(const JourneyRequest &req, Jour
gqlReq.setVariable(QStringLiteral("arriveBy"), req.dateTimeMode() == JourneyRequest::Arrival);
gqlReq.setVariable(QStringLiteral("maxResults"), req.maximumResults());
gqlReq.setVariable(QStringLiteral("lang"), preferredLanguage());
gqlReq.setVariable(QStringLiteral("withIntermediateStops"), req.includeIntermediateStops());
gqlReq.setVariable(QStringLiteral("withPaths"), req.includePaths());
// TODO set context.searchWindow?
QJsonArray modes;
......
......@@ -11,7 +11,9 @@ query journeys(
$arriveBy: Boolean!,
$modes: [TransportMode]!,
$maxResults: Int!,
$lang: String!
$lang: String!,
$withPaths: Boolean!,
$withIntermediateStops: Boolean!
) {
plan (
from: { lat: $fromLat, lon: $fromLon }
......@@ -89,7 +91,7 @@ query journeys(
tripHeadsign
tripShortName
}
intermediateStops: intermediatePlaces {
intermediateStops: intermediatePlaces @include(if: $withIntermediateStops) {
stop {
id: gtfsId
name
......@@ -100,7 +102,7 @@ query journeys(
scheduledArrivalTime: arrivalTime
scheduledDepartureTime: departureTime
}
legGeometry {
legGeometry @include(if: $withPaths) {
length
points
}
......
Supports Markdown
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