# SPDX-FileCopyrightText: 2020 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
                    timezone
                    parentStation {
                        id: gtfsId
                        name
                        lat
                        lon
                        timezone
                    }
                }}
                bikeRentalStation: place { ...on BikeRentalStation {
                    id
                    name
                    lat
                    lon
                    networks,
                    bikesAvailable,
                    spacesAvailable
                }}
            }
        }
    }
}
