Add customer relations contact create mutation
What does this MR do and why?
Adds the ability to create CustomerRelations::Contact
via GraphQL.
See !69472 (merged) for similar MR for CustomerRelations::Organization
Screenshots or screen recordings
How to set up and validate locally
- Enable feature flag from rails console
rails c
Feature.enable(:customer_relations)
- Create an organization (picking a group such as flightjs)
mutation {
customerRelationsOrganizationCreate(input:
{
name: "Hoorah!"
groupId: "gid://gitlab/Group/26"
}) {
organization {
id
name
description
createdAt
updatedAt
}
errors
}
}
- Create contact for the organization:
mutation {
customerRelationsContactCreate(input:
{
groupId: "gid://gitlab/Group/26"
firstName: "Lee"
lastName: "Tickett"
description: "Managing Director"
email: "a@gitlab.example"
phone: "07777 777777"
organizationId: "gid://gitlab/CustomerRelations::Organization/1"
}) {
contact {
id
firstName
lastName
description
email
phone
organization {
id
name
}
createdAt
updatedAt
}
errors
}
}
- Create contact without an organization:
mutation {
customerRelationsContactCreate(input:
{
groupId: "gid://gitlab/Group/26"
firstName: "Lee"
lastName: "Tickett"
description: "Managing Director"
email: "a@gitlab.example"
phone: "07777 777777"
}) {
contact {
id
firstName
lastName
description
email
phone
organization {
id
name
}
createdAt
updatedAt
}
errors
}
}
- Query contacts to ensure persisted and AOK:
query {
group(fullPath: "flightjs") {
contacts {
nodes {
id
firstName
lastName
email
phone
description
organization {
id
name
}
createdAt
updatedAt
}
}
}
}
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 #2256
Edited by Mayra Cabrera