如何在GraphQL wp-graphql中更新嵌套项目

时间:2020-01-13 21:00:46

标签: graphql wp-graphql

我正在尝试编辑自定义帖子类型Ranking中的一种,以便Ranking> ranking> rankingsPost> upvotes内的upvotes字段= 1。我似乎无法通过wp-graphql中的突变来做到这一点。

mutation MyMutation {
  __typename
  updateRanking(input: {clientMutationId: "UpdateRanking", id: "cmFua2luZzo4NjI=", title: "Jamie"}) {
    ranking {
      rankingsPost {
        upvotes
      }
    }
  }
}

但是出现它不是graphQL的选项。如您所见,upvotes嵌套在Rank自定义帖子类型中。

enter image description here

0 个答案:

没有答案