Fix NRE when logged out and reading merge trains via GraphQL

What does this MR do and why?

The current check causes a null reference exception when not logged in.

This MR fixes that and adds tests for the gaps.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image

How to set up and validate locally

query {
  project(fullPath: "flightjs/flight") {
    mergeTrains {
      nodes {
        targetBranch
      }
    }
  }
}

Related to #475269 (closed)

Edited by Lee Tickett

Merge request reports

Loading