Skip to content

Expose public email for users in GraphQL

Sean McGivern requested to merge add-public-email-to-graphql-user into master

What does this MR do?

This is in the REST API: https://docs.gitlab.com/ee/api/users.html#for-user

But until this MR, wasn't in GraphQL. As requested by a customer in https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/670#note_449149917.

For gitlab-com/gl-infra/scalability#686 (closed).

{
  currentUser {
    email
    publicEmail
  }
}

If a user has no public email:

{
  "data": {
    "currentUser": {
      "email": "admin@example.com",
      "publicEmail": ""
    }
  }
}

And if they do:

{
  "data": {
    "currentUser": {
      "email": "admin@example.com",
      "publicEmail": "foo@example.com"
    }
  }
}

Merge request reports