Robert Schäfer cca7d78d25 refactor(backend): put fetch into context
It's a best practice to add HTTP API clients to the `context`. Standard Apollo GraphQL tutorial has an example:
https://www.apollographql.com/docs/apollo-server/data/context#resolvers

Also database drivers, loggers, message queues or process environment defined configuration should go into the `context`, just like HTTP-clients.
2025-06-19 00:41:42 +08:00

255 lines
6.9 KiB
TypeScript

export const berlinEn = {
type: 'FeatureCollection',
query: ['berlin'],
features: [
{
id: 'place.115770',
type: 'Feature',
place_type: ['region', 'place'],
relevance: 1,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpBY1E2',
wikidata: 'Q64',
short_code: 'DE-BE',
},
text_en: 'Berlin',
language_en: 'en',
place_name_en: 'Berlin, Germany',
text: 'Berlin',
language: 'en',
place_name: 'Berlin, Germany',
bbox: [13.08836, 52.338261, 13.760906, 52.675502],
center: [13.38886, 52.517037],
geometry: {
type: 'Point',
coordinates: [13.38886, 52.517037],
},
context: [
{
id: 'country.8762',
mapbox_id: 'dXJuOm1ieHBsYzpJam8',
wikidata: 'Q183',
short_code: 'de',
text_en: 'Germany',
language_en: 'en',
text: 'Germany',
language: 'en',
},
],
},
{
id: 'place.25995500',
type: 'Feature',
place_type: ['place'],
relevance: 1,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpBWXlvN0E',
wikidata: 'Q614184',
},
text_en: 'Berlin',
language_en: 'en',
place_name_en: 'Berlin, Maryland, United States',
text: 'Berlin',
language: 'en',
place_name: 'Berlin, Maryland, United States',
bbox: [-75.364989, 38.141747, -75.087625, 38.4078],
center: [-75.219004, 38.324728],
geometry: {
type: 'Point',
coordinates: [-75.219004, 38.324728],
},
context: [
{
id: 'district.25396972',
mapbox_id: 'dXJuOm1ieHBsYzpBWU9HN0E',
wikidata: 'Q494072',
text_en: 'Worcester County',
language_en: 'en',
text: 'Worcester County',
language: 'en',
},
{
id: 'region.124140',
mapbox_id: 'dXJuOm1ieHBsYzpBZVRz',
wikidata: 'Q1391',
short_code: 'US-MD',
text_en: 'Maryland',
language_en: 'en',
text: 'Maryland',
language: 'en',
},
{
id: 'country.8940',
mapbox_id: 'dXJuOm1ieHBsYzpJdXc',
wikidata: 'Q30',
short_code: 'us',
text_en: 'United States',
language_en: 'en',
text: 'United States',
language: 'en',
},
],
},
{
id: 'place.25970924',
type: 'Feature',
place_type: ['place'],
relevance: 1,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpBWXhJN0E',
wikidata: 'Q1086827',
},
text_en: 'Berlin',
language_en: 'en',
place_name_en: 'Berlin, New Jersey, United States',
text: 'Berlin',
language: 'en',
place_name: 'Berlin, New Jersey, United States',
bbox: [-74.974491, 39.70904, -74.878605, 39.809363],
center: [-74.929456, 39.791432],
geometry: {
type: 'Point',
coordinates: [-74.929456, 39.791432],
},
context: [
{
id: 'district.3016428',
mapbox_id: 'dXJuOm1ieHBsYzpMZ2Jz',
wikidata: 'Q497810',
text_en: 'Camden County',
language_en: 'en',
text: 'Camden County',
language: 'en',
},
{
id: 'region.156908',
mapbox_id: 'dXJuOm1ieHBsYzpBbVRz',
wikidata: 'Q1408',
short_code: 'US-NJ',
text_en: 'New Jersey',
language_en: 'en',
text: 'New Jersey',
language: 'en',
},
{
id: 'country.8940',
mapbox_id: 'dXJuOm1ieHBsYzpJdXc',
wikidata: 'Q30',
short_code: 'us',
text_en: 'United States',
language_en: 'en',
text: 'United States',
language: 'en',
},
],
},
{
id: 'place.26036460',
type: 'Feature',
place_type: ['place'],
relevance: 1,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpBWTFJN0E',
},
text_en: 'Berlin',
language_en: 'en',
place_name_en: 'Berlin, Connecticut, United States',
text: 'Berlin',
language: 'en',
place_name: 'Berlin, Connecticut, United States',
bbox: [-72.840244, 41.554195, -72.712381, 41.652706],
center: [-72.73954, 41.628325],
geometry: {
type: 'Point',
coordinates: [-72.73954, 41.628325],
},
context: [
{
id: 'district.10020588',
mapbox_id: 'dXJuOm1ieHBsYzptT2Jz',
wikidata: 'Q54236',
text_en: 'Hartford County',
language_en: 'en',
text: 'Hartford County',
language: 'en',
},
{
id: 'region.361708',
mapbox_id: 'dXJuOm1ieHBsYzpCWVRz',
wikidata: 'Q779',
short_code: 'US-CT',
text_en: 'Connecticut',
language_en: 'en',
text: 'Connecticut',
language: 'en',
},
{
id: 'country.8940',
mapbox_id: 'dXJuOm1ieHBsYzpJdXc',
wikidata: 'Q30',
short_code: 'us',
text_en: 'United States',
language_en: 'en',
text: 'United States',
language: 'en',
},
],
},
{
id: 'place.26118380',
type: 'Feature',
place_type: ['place'],
relevance: 1,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpBWTZJN0E',
wikidata: 'Q2219095',
},
text_en: 'Berlin Heights',
language_en: 'en',
place_name_en: 'Berlin Heights, Ohio, United States',
text: 'Berlin Heights',
language: 'en',
place_name: 'Berlin Heights, Ohio, United States',
bbox: [-82.54353, 41.285345, -82.382139, 41.364821],
center: [-82.493433, 41.325154],
geometry: {
type: 'Point',
coordinates: [-82.493433, 41.325154],
},
context: [
{
id: 'district.7235308',
mapbox_id: 'dXJuOm1ieHBsYzpibWJz',
wikidata: 'Q111310',
text_en: 'Erie County',
language_en: 'en',
text: 'Erie County',
language: 'en',
},
{
id: 'region.140524',
mapbox_id: 'dXJuOm1ieHBsYzpBaVRz',
wikidata: 'Q1397',
short_code: 'US-OH',
text_en: 'Ohio',
language_en: 'en',
text: 'Ohio',
language: 'en',
},
{
id: 'country.8940',
mapbox_id: 'dXJuOm1ieHBsYzpJdXc',
wikidata: 'Q30',
short_code: 'us',
text_en: 'United States',
language_en: 'en',
text: 'United States',
language: 'en',
},
],
},
],
attribution:
'NOTICE: © 2025 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained.',
}