user.graphql 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # ===============================================
  2. # USERS
  3. # ===============================================
  4. extend type Query {
  5. users (
  6. page: Int
  7. pageSize: Int
  8. orderBy: UserOrderBy
  9. orderByDirection: OrderByDirection
  10. # Filter by name / email
  11. filter: String
  12. ): [UserMinimal]
  13. userById(
  14. id: UUID!
  15. ): User
  16. profile: UserProfile
  17. lastLogins: [UserLastLogin]
  18. }
  19. extend type Mutation {
  20. createUser(
  21. email: String!
  22. name: String!
  23. password: String!
  24. groups: [UUID]!
  25. mustChangePassword: Boolean!
  26. sendWelcomeEmail: Boolean!
  27. ): UserResponse
  28. updateUser(
  29. id: UUID!
  30. patch: UserUpdateInput!
  31. ): DefaultResponse
  32. deleteUser(
  33. id: UUID!
  34. replaceId: UUID!
  35. ): DefaultResponse
  36. verifyUser(
  37. id: UUID!
  38. ): DefaultResponse
  39. activateUser(
  40. id: UUID!
  41. ): DefaultResponse
  42. deactivateUser(
  43. id: UUID!
  44. ): DefaultResponse
  45. enableUserTFA(
  46. id: UUID!
  47. ): DefaultResponse
  48. disableUserTFA(
  49. id: UUID!
  50. ): DefaultResponse
  51. resetUserPassword(
  52. id: Int!
  53. ): DefaultResponse
  54. updateProfile(
  55. name: String!
  56. location: String!
  57. jobTitle: String!
  58. timezone: String!
  59. dateFormat: String!
  60. appearance: String!
  61. ): UserTokenResponse
  62. changePassword(
  63. current: String!
  64. new: String!
  65. ): UserTokenResponse
  66. }
  67. # -----------------------------------------------
  68. # TYPES
  69. # -----------------------------------------------
  70. type UserResponse {
  71. operation: Operation
  72. user: User
  73. }
  74. type UserLastLogin {
  75. id: UUID
  76. name: String
  77. lastLoginAt: Date
  78. }
  79. type UserMinimal {
  80. id: UUID
  81. name: String
  82. email: String
  83. isSystem: Boolean
  84. isActive: Boolean
  85. createdAt: Date
  86. lastLoginAt: Date
  87. }
  88. type User {
  89. id: UUID
  90. name: String
  91. email: String
  92. auth: JSON
  93. isSystem: Boolean
  94. isActive: Boolean
  95. isVerified: Boolean
  96. meta: JSON
  97. prefs: JSON
  98. createdAt: Date
  99. updatedAt: Date
  100. lastLoginAt: Date
  101. groups: [Group]
  102. }
  103. type UserProfile {
  104. id: Int
  105. name: String
  106. email: String
  107. providerKey: String
  108. providerName: String
  109. isSystem: Boolean
  110. isVerified: Boolean
  111. location: String
  112. jobTitle: String
  113. timezone: String
  114. dateFormat: String
  115. appearance: String
  116. createdAt: Date
  117. updatedAt: Date
  118. lastLoginAt: Date
  119. groups: [String]
  120. pagesTotal: Int
  121. }
  122. type UserTokenResponse {
  123. operation: Operation
  124. jwt: String
  125. }
  126. enum UserOrderBy {
  127. id
  128. email
  129. name
  130. createdAt
  131. updatedAt
  132. lastLoginAt
  133. }
  134. input UserUpdateInput {
  135. email: String
  136. name: String
  137. newPassword: String
  138. groups: [UUID!]
  139. isActive: Boolean
  140. isVerified: Boolean
  141. meta: JSON
  142. prefs: JSON
  143. }