Skip to content

Add customer relations contact update mutation to GraphQL

Lee Tickett requested to merge 2256-add-contract-update-mutation into master

What does this MR do and why?

Adds the ability to update a contact via GraphQL. This forms part of the ongoing effort to build a minimum viable solution for customer relations (crm).

Screenshots or screen recordings

image

How to set up and validate locally

1. Create a contact (this uses the FlightJS group in GDK) http://gdk.test:3000/-/graphql-explorer:
mutation {
  customerRelationsContactCreate(input:
    {
      groupId: "gid://gitlab/Group/26"
      firstName: "Apple"
      lastName: "Onion"
      description: "Managing Director"
      email: "ao@gitlab.com"
      phone: "+44 20 3456 3456"
    }) {
    contact {
      id
      firstName
      lastName
      description
      email
      phone
      createdAt
      updatedAt
    }
    errors
  }
}
2. Grab the gid from the response (for me it was gid://gitlab/CustomerRelations::Contact/13)
3. Attempt to update the contact:
mutation {
  customerRelationsContactUpdate(input:
    {
      id: "gid://gitlab/CustomerRelations::Contact/13"
      firstName: "Dave"
      lastName: "Davies"
      description: "Vice President"
      email: "dd@gitlab.com"
      phone: "+44 20 1111 2222"
    }) {
    contact {
      id
      firstName
      lastName
      description
      email
      phone
      createdAt
      updatedAt
    }
    errors
  }
}
4. Confirm the contact is updated as expected (either via the response, via a separate GraphQL query, or via the rails console)

MR acceptance checklist

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

Related to #2256

Edited by Lee Tickett

Merge request reports