Skip to content

Add delete achievement mutation and service

What does this MR do and why?

Add support for deleting achievements via GraphQL.

Related to #385394 (closed)

Screenshots or screen recordings

image

image

image

How to set up and validate locally

  • Enable feature flag in rails console: Feature.enable(:achievements)
  • Find some user achievements (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
  • Delete an achievement
    mutation {
      achievementsDelete(input: {
        achievementId: "gid://gitlab/Achievements::Achievement/88" }) {
        achievement {
          id
          name
        }
        errors
      }
    }
  • Try and delete it again...
  • Query to ensure the achievement no longer gets returned

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