【问题标题】:github graphql api, what does "clientMutationId" mean?github graphql api,“clientMutationId”是什么意思?
【发布时间】:2018-12-20 13:26:51
【问题描述】:

我在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 是什么意思?如何生成它?

【问题讨论】:

    标签: graphql github-api relay github-graphql graphql-relay


    【解决方案1】:

    clientMutationId 与 GraphQL 没有直接关系,但与graphql-relay 有直接关系。

    查看Understanding Relay Mutations 以获得更好的解释。

    clientMutationId。此 ID 由 Relay 客户端在后台生成,用于跟踪突变的进度。

    【讨论】:

    • 另请注意,它是可选的。个人一开始不确定是否需要。
    猜你喜欢
    • 2021-08-27
    • 1970-01-01
    • 1970-01-01
    • 2012-02-21
    • 2019-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-05
    相关资源
    最近更新 更多