知识卡片
选择集明确返回字段
GraphQL 查询使用选择集列出希望返回的字段;对象字段还要继续选择其子字段。客户端由此控制结果的形状,遗漏必需的选择集会触发查询错误。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 9 章《Consuming GraphQL APIs》(源文件:_epub-src/OEBPS/Text/09.htm)
- 结论依据:原文定义花括号内的选择集,并说明缺失时会返回错误。
- 原始内容:The block within curly braces is called a selection set . GraphQL queries must always include a selection set. If you don’t include it, you’ll get an error response from the server.