2020-02-18 07:57:00 +00:00
|
|
|
import gql from "graphql-tag";
|
2019-07-30 08:35:29 +00:00
|
|
|
|
2019-11-08 18:37:14 +00:00
|
|
|
const $addressFragment = `
|
|
|
|
id,
|
|
|
|
description,
|
|
|
|
geom,
|
|
|
|
street,
|
|
|
|
locality,
|
|
|
|
postalCode,
|
|
|
|
region,
|
|
|
|
country,
|
|
|
|
type,
|
|
|
|
url,
|
|
|
|
originId
|
|
|
|
`;
|
|
|
|
|
2019-07-30 08:35:29 +00:00
|
|
|
export const ADDRESS = gql`
|
2021-02-12 17:19:49 +00:00
|
|
|
query($query:String!, $locale: String, $type: AddressSearchType) {
|
2019-07-30 08:35:29 +00:00
|
|
|
searchAddress(
|
2019-11-08 18:37:14 +00:00
|
|
|
query: $query,
|
2021-02-12 17:19:49 +00:00
|
|
|
locale: $locale,
|
|
|
|
type: $type
|
2019-07-30 08:35:29 +00:00
|
|
|
) {
|
2019-11-08 18:37:14 +00: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 08:35:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|