知识卡片
变更解析器按契约写入
变更解析器接收模式声明的参数,构造满足返回类型约束的对象,并执行创建或修改。必须区分必填字段与可选字段的默认值;返回联合类型成员时,还要补齐该成员专有字段并让类型解析器能识别。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 10 章《Building GraphQL APIs with Python》(源文件:_epub-src/OEBPS/Text/10.htm)
- 结论依据:原文以 addProduct 展示 MutationType 绑定、必填参数、可选字段默认值、写入列表及返回产品对象。
- 原始内容:Implementing a mutation resolver follows the same guidelines we saw for queries. The only difference is the class we use to bind the mutation resolvers.