Add availableQuickActions field to MergeRequest GraphQL type
What does this MR do and why?
Adds a MergeRequest.availableQuickActions GraphQL field that returns the quick actions available to the current user on a merge request.
The web comment editor already fetches this set from the :project/-/autocomplete_sources/commands route to power the /-autocomplete. That route is a session-cookie-only web endpoint, so it is not reachable with token auth (OAuth/PAT) and is unavailable to API clients. Exposing the same data as a GraphQL field makes it consumable by API clients (for example, the GitLab mobile app, which renders a /-autocomplete in its comment composer and currently has to hardcode and hand-maintain the command list).
Each command's availability is resolved server-side via QuickActions::InterpretService#available_commands, so the returned set already accounts for:
- the current user's permissions,
- the merge request's state (for example
/mergeonly when mergeable,/reopenonly when closed), - the namespace's licensed features (for example
/weight,/blockson the relevant plans).
No new logic is introduced — the field is a thin GraphQL projection of the existing service that backs the web autocomplete.
New field
MergeRequest.availableQuickActions: [QuickActionCommand!], where QuickActionCommand exposes name, aliases, description, params, warning, and icon — the same shape the autocomplete endpoint returns.
The type and resolver live under the Notes bounded context (alongside NoteableInterface) and operate on any noteable, so the field can be added to other noteables (issues, work items) in follow-ups.
Example query
{
project(fullPath: "gitlab-org/gitlab") {
mergeRequest(iid: "1") {
availableQuickActions {
name
aliases
description
params
}
}
}
}Screenshots or screen recordings
Not applicable — GraphQL field, covered by the generated reference docs and specs.
How to set up and validate locally
- In the GraphiQL explorer (
/-/graphql-explorer), run the query above against a merge request you can access. - Confirm the returned commands match the
/-autocomplete shown in that merge request's comment editor (state- and permission-dependent).
MR acceptance checklist
- I have evaluated the MR acceptance checklist for this MR.
- Documentation (GraphQL reference) regenerated.
- Tests added for type and resolver.