GraphQL DotNet遇到错误的请求错误

时间:2018-12-17 10:56:24

标签: asp.net-core graphql graphql-dotnet

我正在使用GraphQL.Net,并在尝试使用API​​时得到以下提示。

{
  "version": {
    "major": 1,
    "minor": 1,
    "build": -1,
    "revision": -1,
    "majorRevision": -1,
    "minorRevision": -1
  },
  "content": {
    "headers": [
      {
        "key": "Content-Type",
        "value": [
          "application\/json; charset=utf-8"
        ]
      }
    ]
  },
  "statusCode": 400,
  "reasonPhrase": "Bad Request",
  "headers": [

  ],
  "requestMessage": {
    "version": {
      "major": 2,
      "minor": 0,
      "build": -1,
      "revision": -1,
      "majorRevision": -1,
      "minorRevision": -1
    },
    "content": null,
    "method": {
      "method": "GET"
    },
    "requestUri": null,
    "headers": [

    ],
    "properties": {

    }
  },
  "isSuccessStatusCode": false
}

导致错误的原因非常模糊。查询/类型的设置是否有问题?还是我的要求?与认证有关吗?

我不确定要共享哪些代码,因此我将API库上传到:https://github.com/jonasarcangel/GraphQLIssue

请求有效载荷如下(使用Apollo Angular):

{
  "operationName": "configsQuery",
  "variables": {
    "id": "",
    "module": "admin\/configs",
    "name": "canActivate"
  },
  "query": "query configsQuery($id: String, $module: String, $name: String) {\n  configs(id: $id, module: $module, name: $name) {\n    id\n    createdBy\n    createdDate\n    updatedBy\n    updatedDate\n    name\n    module\n    value\n    __typename\n  }\n}\n"
}

0 个答案:

没有答案