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