GitHub GraphQL API,“clientMutationId”是什么意思?

22

我在example-strong-typing文档中看到了clientMutationId字段。

mutation {
  addComment(input:{clientMutationId: 1234, subjectId: "MDA6SXNzdWUyMjcyMDA2MTT=", body: "Looks good to me!"}) {
    clientMutationId
    commentEdge {
      node {
        body
        repository {
          id
          name
          nameWithOwner
        }
        issue {
          number
        }
      }
    }
  }
}

clientMutationId是什么意思?我该如何生成它?

1个回答

23

clientMutationId并不是GraphQL的直接相关概念,但它和graphql-relay有关。

查看理解Relay Mutations获取更好的解释。

clientMutationId。这个ID是由Relay客户端在后台生成,用于跟踪变化的进度。


1
另外请注意,这是可选的。个人一开始也不确定是否需要。 - Aristoatle

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接