Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d54b2edb
Commit
d54b2edb
authored
Nov 24, 2020
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose public email for users in GraphQL
This was available in the REST API, but not the GraphQL API.
parent
a67ac807
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
1 deletion
+30
-1
app/graphql/types/user_type.rb
app/graphql/types/user_type.rb
+2
-0
changelogs/unreleased/add-public-email-to-graphql-user.yml
changelogs/unreleased/add-public-email-to-graphql-user.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+5
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+14
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
spec/graphql/types/user_type_spec.rb
spec/graphql/types/user_type_spec.rb
+1
-0
spec/requests/api/graphql/user_query_spec.rb
spec/requests/api/graphql/user_query_spec.rb
+2
-1
No files found.
app/graphql/types/user_type.rb
View file @
d54b2edb
...
...
@@ -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
,
...
...
changelogs/unreleased/add-public-email-to-graphql-user.yml
0 → 100644
View file @
d54b2edb
---
title
:
Expose public email field for user in GraphQL
merge_request
:
48468
author
:
type
:
changed
doc/api/graphql/reference/gitlab_schema.graphql
View file @
d54b2edb
...
...
@@ -23262,6 +23262,11 @@ type User {
last
:
Int
):
ProjectMemberConnection
"""
User
'
s
public
email
"""
publicEmail
:
String
"""
Snippets
authored
by
the
user
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
d54b2edb
...
...
@@ -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",
doc/api/graphql/reference/index.md
View file @
d54b2edb
...
...
@@ -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 |
...
...
spec/graphql/types/user_type_spec.rb
View file @
d54b2edb
...
...
@@ -15,6 +15,7 @@ RSpec.describe GitlabSchema.types['User'] do
name
username
email
publicEmail
avatarUrl
webUrl
webPath
...
...
spec/requests/api/graphql/user_query_spec.rb
View file @
d54b2edb
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment