【问题标题】:GraphQl and insomnia desktop clients not working with graphql.org/swapi-graphqlGraphQl 和 insomnia 桌面客户端无法使用 graphql.org/swapi-graphql
【发布时间】:2019-09-28 00:23:25
【问题描述】:

我是 graphql 的新手。

访问了网站https://graphql.org/swapi-graphql/并发送了一个简单的查询,就像这样

query {
    allPeople {
      people{
        name
        birthYear
      }
    }
} 

并得到像

这样的响应
{
  "data": {
    "allPeople": {
      "people": [
        {
          "name": "Luke Skywalker",
          "birthYear": "19BBY"
        },
        {
          "name": "C-3PO",
          "birthYear": "112BBY"
        }......so on
        ]
      }
   } 
}

现在我已经下载了insomniagraphiql 等graphql 桌面客户端应用程序

我正在尝试使用 insomnia 和 graphiql 桌面应用程序运行上述相同的查询,但到目前为止未能成功。我失眠了

403 ERROR
The request could not be satisfied.
This distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests. 
Generated by cloudfront (CloudFront)

虽然使用 graphiql 桌面应用程序,但在加载程序不间断运行的情况下似乎存在一些类似的错误。

那么我错过了什么,为什么桌面客户端无法连接到 start war api(https://graphql.org/swapi-graphql) 而 google chrome 浏览器正在工作。谷歌浏览器也是客户端吧?

关于桌面应用程序客户端,我是否遗漏了什么?

【问题讨论】:

    标签: graphql graphiql insomnia


    【解决方案1】:

    看来https://graphql.org/swapi-graphql 正在使用 CloudFront,它仅配置为 GET 和 HEAD,而您正在发出 POST 请求。

    如果您查看该网站,它还会在查询字符串参数中传递查询并发出 GET 请求: https://graphql.org/swapi-graphql/?query=query%20%7B%0A%20%20%20%20allPeople%20%7B%0A%20%20%20%20%20%20people%7B%0A%20%20%20%20%20%20%20%20name%0A%20%20%20%20%20%20%20%20birthYear%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%20

    【讨论】:

      猜你喜欢
      • 2017-03-19
      • 2018-03-25
      • 2022-11-28
      • 2018-04-05
      • 2021-07-25
      • 2021-05-30
      • 2019-06-22
      • 2019-06-01
      • 2020-08-30
      相关资源
      最近更新 更多