【问题标题】:graphene schema for query input is list of dictionary / object查询输入的石墨烯模式是字典/对象列表
【发布时间】:2018-07-30 07:04:37
【问题描述】:

我的查询输入类似于:

[{name: "joe", age: 20}, {name: "bob", age: 30}]

然后我使用解析器返回类似的内容:

[{name: "joe", age: 20}, {name: "bob", age: 30}, {name: "jane", age: 21}]

假设我不更改数据集,因此无需使用 mutate。

我正在使用flask_graphqlgraphene

有什么更好的方法来实现它? (我的意思是如何构建模式)谢谢!

【问题讨论】:

    标签: graphene-python flask-graphql


    【解决方案1】:

    不确定用例,但GenericScalar 可能会有所帮助。

    data = graphene.GenericScalar()
    

    在突变中,这不会有任何特定的架构。输入可以接受任何结构。

    【讨论】:

      猜你喜欢
      • 2021-06-28
      • 2020-05-03
      • 2020-09-07
      • 2020-11-24
      • 2020-11-25
      • 2018-06-28
      • 2020-09-03
      • 1970-01-01
      • 2021-12-17
      相关资源
      最近更新 更多