【问题标题】:GraphQL Union and Input Type?GraphQL 联合和输入类型?
【发布时间】:2017-12-30 12:47:58
【问题描述】:

在 GraphQL 中是否可以有一个输入类型也是一个联合?

类似:

const DynamicInputValueType = new GraphQLUnionType({
  name: 'DynamicInputType',
  types: [GraphQLString, GraphQLFloat, GraphQLInt]
})

但也可以用作突变的输入?

【问题讨论】:

    标签: graphql graphql-js


    【解决方案1】:

    截至 2017 年 9 月,这是不可能的。这个功能周围有一个ongoing discussion

    【讨论】:

    【解决方案2】:

    有一个 npm 模块。我没有测试过。 https://www.npmjs.com/package/graphql-union-input-type

    【讨论】:

      猜你喜欢
      • 2018-03-28
      • 2018-09-28
      • 2019-07-01
      • 2021-03-17
      • 2019-06-30
      • 2020-02-09
      • 2021-04-01
      • 2018-10-22
      相关资源
      最近更新 更多