【发布时间】:2022-02-04 03:03:34
【问题描述】:
我有一个端点来获取数据。端点是
api.openweathermap.org/data/2.5/weather?q={city name}&appid={API key}
它发送的响应如下
{
coord: { lon: 73.2145, lat: 34.1469 },
weather: [
{ id: 801, main: 'Clouds', description: 'few clouds', icon: '02n' }
],
base: 'stations',
main: {
temp: 277.91,
feels_like: 277.91,
temp_min: 277.91,
temp_max: 277.91,
pressure: 1011,
humidity: 85,
sea_level: 1011,
grnd_level: 871
},
visibility: 10000,
wind: { speed: 0.33, deg: 168, gust: 0.44 },
clouds: { all: 20 },
dt: 1643912333,
sys: {
type: 2,
id: 2007435,
country: 'PK',
sunrise: 1643853796,
sunset: 1643891911
},
timezone: 18000,
id: 1185056,
}
如果我要发送一个 graphQL 查询来获取 main 和 wind.How 将如何完成我正在使用 nestJs 一个 nodeJs 框架。
【问题讨论】: