小编sha*_*gun的帖子

Graphql与变异弹簧启动

我的架构文件是

type Mutation {
createCustomer(name: String!, email: String!, product: [Product]): Customer
}

input Product {
    id: ID!
    name: String!
    price: Int
}

interface Person {
    id: ID!
    name: String!
    email: String!
}

type Customer implements Person {
    id: ID!
    name: String!
    email: String!
    product: [Product] 
}
Run Code Online (Sandbox Code Playgroud)

我想在此处插入客户详细信息,其中包含产品列表作为输入.我的疑问是

mutation {
  createCustomer(
    name: "kitte", 
    email: "kitte@gmail.com",
    product: [
      {
         name: "soap", 
             price: 435,
      }
    ]
  ) 
  {
    id
    name
    email
    product{name}

  }
}
Run Code Online (Sandbox Code Playgroud)

但我得到例外

{
  "data": null,
  "errors": [
    {
      "validationErrorType": "WrongType", …
Run Code Online (Sandbox Code Playgroud)

spring-boot graphql

8
推荐指数
1
解决办法
1369
查看次数

如何以流的形式获取httpclient响应

我正在使用 httpclient 4.5.5 我想获得高达 1 gb 的大文件作为响应。但好像

CloseableHttpResponse response = httpClient.execute(httpGet); HttpEntity entity = response.getEntity();

这将返回整个响应,因此在内存中包含整个响应并不好。有没有办法以流的形式获得响应?

java apache apache-httpclient-4.x

3
推荐指数
3
解决办法
9199
查看次数