在 Strawberry GraphQL 查询中注释 return 类型

Annotate return type in Strawberry GraphQL Query

@strawberry.field(description="description of query")
    def sample_query(arg1: Annotated[str, strawberry.argument(description="description of arg1")]) -> list[str]:
...

如何使用说明对输出进行注释?这是允许参数的 PR:https://github.com/strawberry-graphql/strawberry/issues/509

GraphQL 不支持 output descriptions。如果输出是自定义类型,则该类型将有自己的描述。但在这种情况下,我认为在字段描述中包含输出是唯一的选择。