Adjust FeatureSettings Mutation to allow batch updates

What does this MR do and why?

Related to Implement Backend Solution for Expanded Sub-Fea... (#519692 - closed)

  • Adjust FeatureSettings Mutation to allow batch updates

How to Set Up and Validate Locally

1. Enable the Feature Flag

Ensure that the ai_duo_chat_sub_features_settings feature flag is enabled.

2. Login as an Admin

  • Open your browser and go to:
    http://localhost:3000/-/graphql-explorer

3. Verify Ai::SelfHostedModel Record

  • Make sure that an Ai::SelfHostedModel record exists.
  • Use the ID of the record.

4. Execute GraphQL Mutation

Use the following GraphQL mutation to update AI feature settings.

GraphQL Mutation:

mutation AiFeatureSettingUpdate($input: AiFeatureSettingUpdateInput!) {
  aiFeatureSettingUpdate(input: $input) {
    aiFeatureSettings { 
      feature
      provider
      selfHostedModel {
        name
        id
        endpoint
      }
    }
  }
}

Mutation Input:

{
  "input": {
    "features": ["DUO_CHAT_EXPLAIN_CODE", "DUO_CHAT_FIX_CODE", "CODE_GENERATIONS"],
    "provider": "SELF_HOSTED",
    "aiSelfHostedModelId": "gid://gitlab/Ai::SelfHostedModel/3"
  }
}

5. Validate the Response

After running the mutation, verify that the response contains the expected settings.

Request/Response Example:

Screenshot_2025-03-18_at_07.44.46

Screenshot_2025-03-18_at_07.45.01

Screenshot_2025-03-18_at_07.45.18

Edited by Mohamed Hamda

Merge request reports

Loading