Skip to content

Fix branches param in GraphQL MR API queries

Rémy Coutable requested to merge fix-branches-graphql-params into master

What does this MR do and why?

I noticed in https://docs.gitlab.com/ee/api/graphql/reference/#projectmergerequests that the params are targetBranches and sourceBranches.

Using the wrong param shows an error in GraphiQL:

{
  "errors": [
    {
      "message": "Field 'mergeRequests' doesn't accept argument 'targetBranch'",
      "locations": [
        {
          "line": 4,
          "column": 19
        }
      ],
      "path": [
        "query",
        "project",
        "mergeRequests",
        "targetBranch"
      ],
      "extensions": {
        "code": "argumentNotAccepted",
        "name": "mergeRequests",
        "typeName": "Field",
        "argumentName": "targetBranch"
      }
    }
  ]
}
Edited by Rémy Coutable

Merge request reports