hub-api-utils icon indicating copy to clipboard operation
hub-api-utils copied to clipboard

Type mismatch on variable $prID and argument pullRequestId

Open bemoody opened this issue 1 year ago • 0 comments

I found this repo linked from:

https://github.com/mislav/hub/issues/1523#issuecomment-633735369

However, the hub-pr-ready script here appears not to work anymore. The server gives an error:

{"errors":[{"path":["mutation","markPullRequestReadyForReview","input","pullRequestId"],"extensions":{"code":"variableMismatch","variableName":"prID","typeName":"String!","argumentName":"pullRequestId","errorMessage":"Type mismatch"},"locations":[{"line":1,"column":63}],"message":"Type mismatch on variable $prID and argument pullRequestId (String! / ID!)"}]}

It appears that in line 20, $prID: String! should instead be $prID: ID!:

hub api graphql -f query='
  mutation($prID: ID!) {
    markPullRequestReadyForReview(
      input: {pullRequestId: $prID}
    ){ clientMutationId }
  }
' -f "prID=$id" >/dev/null

(disclaimer: I know next to nothing about GraphQL.)

bemoody avatar Aug 18 '23 21:08 bemoody