# SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: CC0-1.0

query journeys(
  $fromLat: Float!,
  $fromLon: Float!,
  $toLat: Float!,
  $toLon: Float!,
  $date: String!,
  $time: String!,
  $arriveBy: Boolean!,
  $maxResults: Int!
) {
  plan (
        from: { lat: $fromLat, lon: $fromLon }
        to:   { lat: $toLat,   lon: $toLon }
        date: $date
        time: $time
        arriveBy: $arriveBy
        numItineraries: $maxResults
    ) {
        itineraries {
            legs {
                startTime
                endTime
                realTime
                distance
                mode
                transitLeg
                from {
                    name
                    lat
                    lon
                    stop {
                        id: gtfsId
                        platformCode
                        timezone
                    }
                }
                to {
                    name
                    lat
                    lon
                    stop {
                        id: gtfsId
                        platformCode
                        timezone
                    }
                }
                trip {
                    route {
                        type
                        desc
                        shortName
                        longName
                        color
                        textColor
                        bikesAllowed
                        alerts {
                            alertHeaderTextTranslations {
                                language
                                text
                            }
                            alertDescriptionTextTranslations {
                                language
                                text
                            }
                        }
                    }
                    tripHeadsign
                    tripShortName
                }
            }
        }
    }
}
