Add GraphQL mutation to update Organization
What does this MR do and why?
This is part of the ongoing Organization work by the grouptenant scale group. Read the blueprint to learn more https://docs.gitlab.com/ee/architecture/blueprints/organization/index.html.
This is a follow-up of !135176 (merged) where we added a mutation to create an organization.
Query plans
Raw query
UPDATE "organizations"
SET "updated_at" = '2023-11-30 08:51:53.651717',
"name" = 'git',
"path" = 'gitlab2'
WHERE "organizations"."id" = 1033;
Raw query
UPDATE "organization_details"
SET "updated_at" = '2023-11-30 08:51:53.655069',
"description" = 'gitLab',
"description_html" = '<p data-sourcepos="1:1-1:6" dir="auto">gitLab</p>'
WHERE "organization_details"."organization_id" = 1033;
How to set up and validate locally
-
Follow the steps here to create an organization !137616 (merged).
-
Create an organization user with the returned organization id and your user id in rails console:
Organizations::OrganizationUser.create(organization_id: 1033, user: <your-user>)
-
Run the following mutation on https://gdk.test:3000/-/graphql-explorer:
mutation {
organizationUpdate(
input: {id: "gid://gitlab/Organizations::Organization/1033", name: "gi", path: "gi", description: "gitLab2"}
) {
organization {
id
name
path
description
descriptionHtml
}
errors
}
}
Output:
{
"data": {
"organizationUpdate": {
"organization": {
"id": "gid://gitlab/Organizations::Organization/1033",
"name": "gi",
"path": "gi",
"description": "gitLab2",
"descriptionHtml": "<p data-sourcepos=\"1:1-1:7\" dir=\"auto\">gitLab2</p>"
},
"errors": []
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #419608 (closed)