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

使用graphene-django 3.1.2时GraphQLResolveInfo无field_asts属性问题咨询

问题解答:graphene-django 3.1.2中ResolveInfo导入与field_asts属性缺失问题
  • 你用GraphQLResolveInfo替代ResolveInfo的做法是正确的。graphene-django 3.x版本依赖的graphql-core 3.x系列中,原ResolveInfo类已被重命名为GraphQLResolveInfo,所以这个导入替换逻辑没问题。
  • 出现'GraphQLResolveInfo' object has no attribute 'field_asts'错误的核心原因:graphql-core 3.x对内部API做了重构,移除了field_asts属性,改用field_nodes作为替代属性。
  • 解决方法:将代码中所有访问info.field_asts的地方替换为info.field_nodes,导入语句保持from graphql import GraphQLResolveInfo as ResolveInfo即可。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.26 01:28:11