i 正在使用继器和图表ql,以图 an,但当试图与它连接起来时,它却在使用图表显示不好的要求时,即认为它有点可做的事情,即,一经审判,一意抓它,而一行没有显示有哪一线错误。
** 印发。
Unhandled Runtime Error
Error: Connector: HTTP Error: Bad Request
Call Stack
call
node_modules@apolloclienterrorserrors.cjs (31:27)
eval
node_modules@apolloclientcorecore.cjs (1843:46)
examiner
node_modules@apolloclientutilitiesutilities.cjs (1072:52)
callback
node_modules@apolloclientutilitiesutilities.cjs (1065:71)
new Promise
<anonymous>
Object.then
node_modules@apolloclientutilitiesutilities.cjs (1065:23)
then
node_modules@apolloclientutilitiesutilities.cjs (1073:48)
call
node_moduleszen-observablelibObservable.js (135:17)
notifySubscription
node_moduleszen-observablelibObservable.js (179:2)
onNotify
node_moduleszen-observablelibObservable.js (235:6)
argument
node_modules@apolloclientutilitiesutilities.cjs (1055:68)
Array.forEach
<anonymous>
forEach
node_modules@apolloclientutilitiesutilities.cjs (1055:24)
iterateObserversSafely
node_modules@apolloclientutilitiesutilities.cjs (1147:20)
call
node_moduleszen-observablelibObservable.js (135:17)
notifySubscription
node_moduleszen-observablelibObservable.js (179:2)
onNotify
node_moduleszen-observablelibObservable.js (235:6)
call
node_modules@apolloclientlinkhttphttp.cjs (329:69)
**
import {gql} from @apollo/client
export const fetchWeatherQueries = gql`
query MyQuery (
$current_weather: String
$daily: String = " weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,uv_index_max,uv_index_clear_sky_max"
$hourly: String = "temperature_2m,relativehumidity_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall,snow_depth,visibility,windgusts_10m,uv_index,uv_index_clear_sky"
$latitude: String!
$longitude: String!
$timezone: String!
) {
myQuery(
current_weather: $current_weather
daily: $daily
hourly: $hourly
latitude: $latitude
longitude: $longitude
timezone: $timezone
) {
elevation
generationtime_ms
latitude
longitude
timezone
timezone_abbreviation
utc_offset_seconds
daily_units {
apparent_temperature_max
apparent_temperature_min
sunrise
sunset
temperature_2m_max
time
temperature_2m_min
uv_index_clear_sky_max
uv_index_max
weathercode
}
hourly {
apparent_temperature
precipitation
precipitation_probability
rain
relativehumidity_2m
showers
snow_depth
snowfall
temperature_2m
time
uv_index
uv_index_clear_sky
visibility
windgusts_10m
}
hourly_units {
windgusts_10m
visibility
uv_index_clear_sky
uv_index
time
temperature_2m
snowfall
snow_depth
showers
relativehumidity_2m
rain
precipitation_probability
precipitation
apparent_temperature
}
current_weather {
is_day
temperature
time
weathercode
winddirection
windspeed
}
daily {
apparent_temperature_max
apparent_temperature_min
sunrise
sunset
temperature_2m_max
temperature_2m_min
time
uv_index_clear_sky_max
uv_index_max
weathercode
}
}
}
`;
页: 1
import { getClient } from "@/apollo-client"
import {fetchWeatherQueries} from "@/graphql/queries/fetchWeatherQueries"
type Props ={
params:{
city:string,
latitude:string,
longitude:string
}
}
async function WeatherPage({params : {city , latitude , longitude}}:Props) {
const client = getClient();
const {data} = await client.query({
query: fetchWeatherQueries,
variables:{
current_weather: "true",
latitude : latitude,
longitude : longitude,
timezone : "auto",
}
})
const results : Root = data.myQuery;
}
i) 如果复制机能发挥作用,可提供复印机链接。
"https://api.open-meteo.com/v1/forecast?latitude=51.51&longitude=0.13&hourly=temperature_2m,relativehumidity_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall,snow_depth,visibility,windgusts_10m,uv_index,uv_index_clear_sky&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,uv_index_max,uv_index_clear_sky_max¤t_weather=true&timezone=auto"