在使用Graphql python时在解析器方法中理解`parent`参数

问题描述 投票:0回答:1

我一直在尝试在Graphql中使用parent来解决问题。希望有人给我他们自己的理解以及所有解析器方法。我还阅读了[[docs。

class Person(ObjectType): # First_name is a field with a resolver that fetches data in our schema first_name = String() last_name = String() def resolve_full_name(parent, info): return f"{parent.first_name} {parent.last_name}"
python graphql graphene-python
1个回答
0
投票
因此,Parent实际上是在解析器运行后引用值对象的,默认情况下它设置为None。请参阅this
© www.soinside.com 2019 - 2024. All rights reserved.