You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Postman刷新GraphQL Schema失败:空查询致Spring Boot报错

Postman刷新GraphQL Schema触发Spring Boot空查询错误

我在使用Postman配合Spring Boot进行GraphQL请求时,尝试刷新Schema时应用抛出如下错误:

graphql.AssertException: query can't be null
at graphql.Assert.assertNotNull(Assert.java:17)
at graphql.ExecutionInput$Builder.query(ExecutionInput.java:204)
at graphql.kickstart.execution.input.GraphQLSingleInvocationInput.createExecutionInput(GraphQLSingleInvocationInput.java:47)

经排查,问题根源是Postman发送的刷新查询为空,@Postman团队请修复此问题。

正确的自省查询应为:

query IntrospectionQuery {
  __schema {
    queryType {
      name
    }
    mutationType {
      name
    }
    subscriptionType {
      name
    }
  }
}

(注:原示例查询未闭合,已补充完整语法)

内容的提问来源于stack exchange,提问作者Fatih AKSOY

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 09:01:04