Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. import {
  2. GraphQLObjectType,
  3. GraphQLID,
  4. GraphQLString,
  5. GraphQLInt,
  6. GraphQLBoolean,
  7. GraphQLList
  8. } from 'graphql';
  9.  
  10. import * as PhoneNumberType from './phone.number.type';
  11. import * as EmailAddressType from './email.address.type';
  12. import TimestampType from '../custom-types/timestamp.type';
  13.  
  14. var UserType = new GraphQLObjectType({
  15. name: 'User',
  16. fields: () => ({
  17. _id: { type: GraphQLID },
  18. username: {
  19. type: GraphQLString,
  20. description: 'Public string that combined with the password, will identify the user.'
  21. },
  22. password: {
  23. type: GraphQLString,
  24. description: 'Secret string that combined with the username, will identify the user.'
  25. },
  26. token: {
  27. type: GraphQLString,
  28. description: 'Alphanumeric string that will be provided by the user in order to work with the application, once it is successfully authenticated.'
  29. },
  30. role: {
  31. type: GraphQLInt,
  32. description: 'Access leved assigned to the user.'
  33. },
  34. name: {
  35. type: GraphQLString,
  36. description: 'User\'s first name.'
  37. },
  38. surname: {
  39. type: GraphQLString,
  40. description: 'User\'s second name.'
  41. },
  42. phoneNumber: {
  43. type: new GraphQLList(PhoneNumberType.ObjectType),
  44. description: 'Set of available phone numbers for the user.'
  45. },
  46. emailAddress: {
  47. type: new GraphQLList(EmailAddressType.ObjectType),
  48. description: 'Set of available email address for the user.'
  49. },
  50. locale: {
  51. type: GraphQLString,
  52. description: 'User\'s language.'
  53. },
  54. isEnabled: {
  55. type: GraphQLBoolean,
  56. description: 'This field defines if the user is able to work with the application.'
  57. },
  58. lastLoginTimestamp: {
  59. type: TimestampType,
  60. description: 'This field contains the user\'s last successful login timestamp.'
  61. },
  62. createdAt: {
  63. type: TimestampType,
  64. description: 'This field contains the timestamp when the user was recorded on the database.'
  65. },
  66. createdBy: {
  67. type: GraphQLID,
  68. description: 'This field contains ID of the user or entity that created this user.'
  69. },
  70. updatedAt: {
  71. type: TimestampType,
  72. description: 'This field contains the last timestamp the user record was updated.'
  73. },
  74. updatedBy: {
  75. type: GraphQLID,
  76. description: 'This field contains ID of the user or entity that updated this user.'
  77. },
  78. })
  79. });
  80.  
  81. export default UserType;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement