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:
-
Move the latest_versions_by_project_id
query intoapp/finders/releases_finder.rb
. Ref: !118997 (comment 1375736603)
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 beindex_by
?
-
Consider replacing latestVersion
withversions(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
}
}
}
}
-
Make latestVersion
orversions
field more secure. Ref: !118997 (comment 1385753543)
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