【问题标题】:How to add a parameter to a graphql query with edges and nodes如何将参数添加到带有边和节点的 graphql 查询
【发布时间】:2021-02-06 15:26:04
【问题描述】:

要返回所有数据,我可以使用

    {
      allEmployees {
        edges {
          node {
            id
            name
          }
        }
      }
    }

我有变量 {"name": "Roy"}

如何选择所有名为 Roy 的员工?

【问题讨论】:

    标签: graphql graphiql


    【解决方案1】:

    这取决于您的 GraphQL 架构是什么样的。过滤等功能不是 GraphQL 的一部分,它们是您可以构建到 GraphQL 架构中的东西。我会调查allEmployees 字段接受哪些参数。

    【讨论】:

      猜你喜欢
      • 2019-12-30
      • 2020-11-07
      • 2021-03-04
      • 2019-10-20
      • 2019-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-03
      相关资源
      最近更新 更多