digitransit-ui/app/component/itinerary/PlanConnection.js
Vesa Meskanen cf42223474 chore: update PlanConnection parameter
Number of itineraries is now defined by 'first' parameter.
2024-05-08 14:18:58 +03:00

109 lines
2.4 KiB
JavaScript

import { graphql } from 'react-relay';
const planConnection = graphql`
query PlanConnectionQuery(
$fromPlace: PlanLabeledLocationInput!
$toPlace: PlanLabeledLocationInput!
$modes: PlanModesInput!
$datetime: PlanDateTimeInput!
$walkReluctance: Reluctance
$walkBoardCost: Cost
$minTransferTime: Duration
$walkSpeed: Speed
$wheelchair: Boolean
$transferPenalty: Cost
$bikeSpeed: Speed
$allowedBikeRentalNetworks: [String!]
$after: String
$first: Int
$before: String
$last: Int
) {
plan: planConnection(
dateTime: $datetime
after: $after
first: $first
before: $before
last: $last
origin: $fromPlace
destination: $toPlace
modes: $modes
preferences: {
accessibility: { wheelchair: { enabled: $wheelchair } }
street: {
bicycle: {
speed: $bikeSpeed
rental: { allowedNetworks: $allowedBikeRentalNetworks }
}
walk: {
speed: $walkSpeed
reluctance: $walkReluctance
boardCost: $walkBoardCost
}
}
transit: {
transfer: { cost: $transferPenalty, slack: $minTransferTime }
}
}
) {
searchDateTime
routingErrors {
code
inputField
}
pageInfo {
startCursor
endCursor
}
edges {
...ItineraryListContainer_planEdges
node {
...ItineraryDetails_itinerary
duration
walkDistance
emissionsPerPerson {
co2
}
legs {
...ItineraryLine_legs
mode
distance
transitLeg
legGeometry {
points
}
route {
gtfsId
}
trip {
gtfsId
directionId
stoptimesForDate {
scheduledDeparture
}
}
from {
lat
lon
stop {
gtfsId
}
vehicleRentalStation {
stationId
}
}
to {
lat
lon
stop {
gtfsId
}
}
}
}
}
}
}
`;
export default planConnection;