2019-07-30 08:35:29 +00:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
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`
|
2019-11-08 18:37:14 +00:00
|
|
|
query($query:String!, $locale: String) {
|
2019-07-30 08:35:29 +00:00
|
|
|
searchAddress(
|
2019-11-08 18:37:14 +00:00
|
|
|
query: $query,
|
|
|
|
locale: $locale
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|