使用graphql-tools的makeExecutableSchema捕获并设置自定义错误

时间:2018-11-30 16:16:05

标签: graphql graphql-tools

我正在使用makeExecutableSchema中的graphql-tools来实现我的graphql模式,我认为从解析器返回的数据映射到字段后会引发一些错误,例如:

Error: Expected a value of type "yyy" but received: zzz

我想通过添加代码来自定义此错误,但是我不知道该在哪里做。

0 个答案:

没有答案