gpt4 book ai didi

python-3.x - 在 Strawberry GraphQL Resolver 中获取请求的字段

转载 作者:行者123 更新时间:2023-12-05 01:50:26 26 4
gpt4 key购买 nike

我们如何在 Strawberry GraphQL Resolver 中获取请求的字段

query{
test{
label
}
}```

How i can get label field in resolver.

I have tried

info.field_nodes[0].selection_set.selections


But it is not giving what i want

最佳答案

{selection.name for field in info.selected_fields for selection in field.selections}

关于python-3.x - 在 Strawberry GraphQL Resolver 中获取请求的字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73079276/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com