typegraphql - 类型 graphql - 将 createUnionType 设置为 InputType
问题描述
我正在使用type-graphql
框架,并且我配置了一个联合类型,如下所示:
export const ActionUnion = createUnionType({
name: 'ActionUnion',
types: () => [CreateAction, UpdateAction, DeleteAction],
});
我想用它作为我的变异输入。但是当我运行该服务时,我收到一条错误消息:
Cannot determine GraphQL input type for userActions
有没有办法将 unionType 也配置为 InputType ?
提前致谢。
解决方案
不,在 GraphQL 规范中,联合仅适用于对象类型。你不能有联合输入。
推荐阅读
- django - 有没有办法让鹡鸰身体字段只读?
- android - 从 Android 应用程序访问 i.mx6 板上的 I2C
- javascript - 一个人如何使用不和谐机器人将频道添加到某个类别?
- jquery - 通过 JQuery 使用 SlideDown 和 SlideUp 更改图标
- c++ - 有人可以解释一下,为什么这段代码不需要函数定义?
- c# - DataGrid datagridComboxColumn 不显示值
- vue.js - 如何使用 content-type:application/json 在 vue 中跳过 Preflight Requset
- adsense - Adsense - 我们发现您的网站已关闭或不可用
- mysql - SQL FOREIGN KEY CONSTRAINT 命名差异
- virtual-machine - Oracle VirtualBox - 无法导入图像