Django / GraphQL——两种类型的字段相互引用会导致崩溃
我有 2 个 graphql 类型,每个类型都有引用另一个类型的字段。出现错误是因为读取第一个类型时尚未声明其中一个类型。问题是该类型应该在字段中使用之前实例化。但由于这两种类型相互引用,因此始终会在实例化 One 之前引用它。
关于如何解决的任何想法?
以下是相关代码部分的链接: https://gist.github.com/olivermontalbano/ce8db9fd62619b983ed68b6933ff7e64
I have 2 graphql types that each have fields that refer to the other. There is an error because one of the types has not been declared when the first one is read. The issue is that the type should be instantiated before using it in a field. But since the two types refer to each other, One is always being referred to before it has been instantiated.
Any ideas on how to solve?
Here is a link to the parts of the code that are relevant:
https://gist.github.com/olivermontalbano/ce8db9fd62619b983ed68b6933ff7e64
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论