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

query stopsByCoordinate(
    $lat: Float!,
    $lon: Float!,
    $radius: Int!,
    $maxResults: Int!,
    $placeType: [FilterPlaceType]!
) {
    stopsByRadius: nearest(
        lat: $lat,
        lon: $lon,
        maxDistance: $radius,
        maxResults: $maxResults,
        filterByPlaceTypes: $placeType
    ) {
        edges {
            node {
                stop: place { ...on Stop {
                    id: gtfsId
                    name
                    lat
                    lon
                    vehicleMode
                    parentStation {
                        id: gtfsId
                        name
                        lat
                        lon
                    }
                }}
                bikeRentalStation: place { ...on BikeRentalStation {
                    id
                    name
                    lat
                    lon
                    networks,
                    bikesAvailable,
                    spacesAvailable
                }}
            }
        }
    }
}
