forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser-shared.js
More file actions
25 lines (23 loc) · 801 Bytes
/
user-shared.js
File metadata and controls
25 lines (23 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { GraphQLObjectType, GraphQLString } from 'graphql'
import { globalIdField } from 'graphql-relay'
import { GraphQLEmailAddress } from 'graphql-scalars'
import { nodeInterface } from '../../node'
export const userSharedType = new GraphQLObjectType({
name: 'SharedUser',
fields: () => ({
id: globalIdField('user'),
displayName: {
type: GraphQLString,
description: 'Users display name.',
resolve: ({ displayName }) => displayName,
},
userName: {
type: GraphQLEmailAddress,
description: 'Users email address.',
resolve: ({ userName }) => userName,
},
}),
interfaces: [nodeInterface],
description: `This object is used for showing none personal user details,
and is used for limiting admins to the personal details of users.`,
})