Skip to content

Implement GraphQL mutation/subscription for AI

Patrick Bajao requested to merge 404504-graphql-ai into master

What does this MR do and why?

This adds the aiAction mutation that can be used by consumers to execute an AI action. Currently a no-op since service layer is implemented in a separate MR.

This also adds aiCompletionResponse subscription that will be triggered by the service layer once it gets response from AI service.

Changes in this MR are extracted from !116583 (closed) where it was initially integrated.

How to set up and validate locally

Sample GraphQL mutation

mutation {
  aiAction(input: {summarizeComments: {resourceId: "gid://gitlab/Issue/52"}}) {
    clientMutationId
  }
}

executing this should return success

{
  "data": {
    "aiAction": {
      "clientMutationId": null
    }
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #404504

Edited by Brett Walker

Merge request reports