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 ...@@ -20,6 +20,8 @@ module Types
description: 'State of the user' description: 'State of the user'
field :email, GraphQL::STRING_TYPE, null: true, field :email, GraphQL::STRING_TYPE, null: true,
description: 'User email' description: 'User email'
field :public_email, GraphQL::STRING_TYPE, null: true,
description: "User's public email"
field :avatar_url, GraphQL::STRING_TYPE, null: true, field :avatar_url, GraphQL::STRING_TYPE, null: true,
description: "URL of the user's avatar" description: "URL of the user's avatar"
field :web_url, GraphQL::STRING_TYPE, null: false, 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 { ...@@ -23262,6 +23262,11 @@ type User {
last: Int last: Int
): ProjectMemberConnection ): ProjectMemberConnection
"""
User's public email
"""
publicEmail: String
""" """
Snippets authored by the user Snippets authored by the user
""" """
......
...@@ -67483,6 +67483,20 @@ ...@@ -67483,6 +67483,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "publicEmail",
"description": "User's public email",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "snippets", "name": "snippets",
"description": "Snippets authored by the user", "description": "Snippets authored by the user",
...@@ -3485,6 +3485,7 @@ Autogenerated return type of UpdateSnippet. ...@@ -3485,6 +3485,7 @@ Autogenerated return type of UpdateSnippet.
| `location` | String | The location of the user. | | `location` | String | The location of the user. |
| `name` | String! | Human-readable name of the user | | `name` | String! | Human-readable name of the user |
| `projectMemberships` | ProjectMemberConnection | Project memberships of the user | | `projectMemberships` | ProjectMemberConnection | Project memberships of the user |
| `publicEmail` | String | User's public email |
| `snippets` | SnippetConnection | Snippets authored by the user | | `snippets` | SnippetConnection | Snippets authored by the user |
| `starredProjects` | ProjectConnection | Projects starred by the user | | `starredProjects` | ProjectConnection | Projects starred by the user |
| `state` | UserState! | State of the user | | `state` | UserState! | State of the user |
......
...@@ -15,6 +15,7 @@ RSpec.describe GitlabSchema.types['User'] do ...@@ -15,6 +15,7 @@ RSpec.describe GitlabSchema.types['User'] do
name name
username username
email email
publicEmail
avatarUrl avatarUrl
webUrl webUrl
webPath webPath
......
...@@ -82,7 +82,8 @@ RSpec.describe 'getting user information' do ...@@ -82,7 +82,8 @@ RSpec.describe 'getting user information' do
'username' => presenter.username, 'username' => presenter.username,
'webUrl' => presenter.web_url, 'webUrl' => presenter.web_url,
'avatarUrl' => presenter.avatar_url, 'avatarUrl' => presenter.avatar_url,
'email' => presenter.email 'email' => presenter.email,
'publicEmail' => presenter.public_email
)) ))
expect(graphql_data['user']['status']).to match( 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