Skip to content

Follow-up from "Backend: CI Catalog - Add additional fields to GraphQL query"

This is a follow-up issue from Backend: CI Catalog - Add additional fields to ... (#407382 - closed).

The following discussions from the MR Add GraphQL field `latest_version` to CiCatalog... (!118997 - closed) should be addressed:

I wonder if we should try and extend app/finders/releases_finder.rb finder instead here and leave the only part to be called in the resolver to be index_by?

  • Consider replacing latestVersion with versions(last: 1). This will probably require the Releases finder to be refactored to support releases for multiple projects. Ref: !118997 (comment 1384395889)

We generally want the API to support latest by using the following pattern:

query getCiCatalogResources {
  ciCatalogResources(projectPath: "group-a/project-catalog-resource-1") {
    nodes {
      id
      name
      versions(last: 1) {
        tagName
        releasedAt
      }
    }
  }
}

Maybe VersionType should have limited fields so that it doesn't expose more than it has to. Or we could change how we implement our authorization policy with respect to releases.

Edited by Leaminn Ma