Skip to content

Add achievement update GraphQL mutation

What does this MR do and why?

Related to #398124 (closed)

Add the ability to update achievements via GraphQL.

Screenshots or screen recordings

image

How to set up and validate locally

  • Enable feature flag in rails console: Feature.enable(:achievements)
  • Find an achievement (you may need to run the seed depending on the age of your database: bundle exec rake db:seed_fu FILTER=36_achievements) http://gdk.test:3000/-/graphql-explorer
    query {
      namespace(fullPath: "gitlab-org") {
        achievements {
          nodes {
            id
            name
          }
        }
      }
    }
    Or you can use the rails console: Achievements::Achievement.all
  • Update an achievement
    mutation {
      achievementsUpdate(input: {
        achievementId: "gid://gitlab/Achievements::Achievement/88"
        name: "Superstar"}) {
        achievement {
          id
          name
        }
        errors
      }
    }
  • Query to ensure the achievement was updated

MR acceptance checklist

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

Edited by Lee Tickett

Merge request reports

Loading