2020-02-18 08:57:00 +01:00
|
|
|
import gql from "graphql-tag";
|
2019-07-30 10:35:29 +02:00
|
|
|
|
2019-11-08 19:37:14 +01:00
|
|
|
const $addressFragment = `
|
|
|
|
id,
|
|
|
|
description,
|
|
|
|
geom,
|
|
|
|
street,
|
|
|
|
locality,
|
|
|
|
postalCode,
|
|
|
|
region,
|
|
|
|
country,
|
|
|
|
type,
|
|
|
|
url,
|
|
|
|
originId
|
|
|
|
`;
|
|
|
|
|
2019-07-30 10:35:29 +02:00
|
|
|
export const ADDRESS = gql`
|
2021-02-12 18:19:49 +01:00
|
|
|
query($query:String!, $locale: String, $type: AddressSearchType) {
|
2019-07-30 10:35:29 +02:00
|
|
|
searchAddress(
|
2019-11-08 19:37:14 +01:00
|
|
|
query: $query,
|
2021-02-12 18:19:49 +01:00
|
|
|
locale: $locale,
|
|
|
|
type: $type
|
2019-07-30 10:35:29 +02:00
|
|
|
) {
|
2019-11-08 19:37:14 +01:00
|
|
|
${$addressFragment}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const REVERSE_GEOCODE = gql`
|
|
|
|
query($latitude: Float!, $longitude: Float!, $zoom: Int, $locale: String) {
|
|
|
|
reverseGeocode(latitude: $latitude, longitude: $longitude, zoom: $zoom, locale: $locale) {
|
|
|
|
${$addressFragment}
|
2019-07-30 10:35:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|