【问题标题】:Rails GraphQL nested mutation/query structureRails GraphQL 嵌套突变/查询结构
【发布时间】:2019-11-14 12:07:48
【问题描述】:

我需要一些方法在 Rails 中构建 GraphQL API。 我看到大多数开发人员都会进行 GraphQL 查询和突变等大链

{
  mutation {
    updateProfile(firstName: "Luke", lastname: "Skywalker") {
      id
      firstName
      lastName
    }
  }
}
{
  mutation {
    deleteProfile()
  }
}

等等

我想要命名空间之类的东西。示例

例如

{
  mutation {
   me {
     profile {
       update(firstName: "Luke", lastname: "Skywalker") {
         id
         firstName
         lastName
       }
     }
   }
  }
}

谢谢大家的回答

【问题讨论】:

    标签: ruby-on-rails ruby graphql


    【解决方案1】:

    很遗憾,这是 GraphQL 规范 (https://graphql.github.io/graphql-spec/June2018/) 所不允许的。

    【讨论】:

      猜你喜欢
      • 2019-08-24
      • 2020-04-24
      • 2018-08-24
      • 2021-04-09
      • 2016-09-08
      • 2021-01-29
      • 2020-12-02
      • 2017-07-28
      • 2019-04-10
      相关资源
      最近更新 更多