Skip to content

Merge request note's postion.newPath property causes a 500 error in GraphQL

Run this query:

query projectFetch($path: ID!, $iid: String!) {
  project(fullPath: $path) {
    mergeRequests(iids: [$iid]) {
      nodes {
        notes {
          nodes {
            position {
              newPath
            }
          }
        }
      }
    }
  }
}

With these variables:

{"path": "issue-reproduce/241143-remove-commit/detached-pipelines", "iid": "1"}

It will give a 500 error: https://sentry.gitlab.net/gitlab/gitlabcom/issues/1867674/

Failed to implement DiffPosition.newPath, tried:

  • Types::Notes::DiffPositionType#new_path, which did not exist
  • String#new_path, which did not exist
  • Looking up hash key :new_path or "new_path" on {}, but it wasn't a Hash To implement this field, define one of the methods above (and check for typos)

The problem note is this one. Seemingly it has to start with A\n\n and maybe (?) be edited: issue-reproduce/241143-remove-commit/detached-pipelines!1 (comment 418804438)