English 中文(简体)
Unhandled Rugtime Error Error:Linkor: HTTP Error: Bad Request
原标题:Unhandled Runtime Error Error: Connector: HTTP Error: Bad Request

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&current_weather=true&timezone=auto"

最佳回答

inside my query one space was extra correct one is here :

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!
  )  {
问题回答

I didn t understand the extra space, can you please explain more to it or can you tell me how to correct it as I am facing the same issue? Thanks in advance.





相关问题
store data in memory with nestjs

I am trying to persist some data in my nestjs server so I can then use that data in my client app through http requests. I have created a products.service.ts file with the function getAllData() that ...

React Hook Form Error on custom Input component

I am having a problem when I use react hook form + zod in my application, in short the inputs never change value and I get the following error in the console: Warning: Function components cannot be ...

Updatable promises using proxy in JavaScript

EDIT: I ve updated this question, and the old question is moved here. A POC can be found on this jsfiddle or the snippet below GOAL: The goal here is to make or rather simulate a promise that can be ...

热门标签