Commit d54b2edb authored by Sean McGivern's avatar Sean McGivern

Expose public email for users in GraphQL

This was available in the REST API, but not the GraphQL API.
parent a67ac807
......@@ -20,6 +20,8 @@ module Types
description: 'State of the user'
field :email, GraphQL::STRING_TYPE, null: true,
description: 'User email'
field :public_email, GraphQL::STRING_TYPE, null: true,
description: "User's public email"
field :avatar_url, GraphQL::STRING_TYPE, null: true,
description: "URL of the user's avatar"
field :web_url, GraphQL::STRING_TYPE, null: false,
......
---
title: Expose public email field for user in GraphQL
merge_request: 48468
author:
type: changed
......@@ -23262,6 +23262,11 @@ type User {
last: Int
): ProjectMemberConnection
"""
User's public email
"""
publicEmail: String
"""
Snippets authored by the user
"""
......
......@@ -67483,6 +67483,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "publicEmail",
"description": "User's public email",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "snippets",
"description": "Snippets authored by the user",
......@@ -3485,6 +3485,7 @@ Autogenerated return type of UpdateSnippet.
| `location` | String | The location of the user. |
| `name` | String! | Human-readable name of the user |
| `projectMemberships` | ProjectMemberConnection | Project memberships of the user |
| `publicEmail` | String | User's public email |
| `snippets` | SnippetConnection | Snippets authored by the user |
| `starredProjects` | ProjectConnection | Projects starred by the user |
| `state` | UserState! | State of the user |
......
......@@ -15,6 +15,7 @@ RSpec.describe GitlabSchema.types['User'] do
name
username
email
publicEmail
avatarUrl
webUrl
webPath
......
......@@ -82,7 +82,8 @@ RSpec.describe 'getting user information' do
'username' => presenter.username,
'webUrl' => presenter.web_url,
'avatarUrl' => presenter.avatar_url,
'email' => presenter.email
'email' => presenter.email,
'publicEmail' => presenter.public_email
))
expect(graphql_data['user']['status']).to match(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment