user.graphql 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. }
  63. # -----------------------------------------------
  64. # TYPES
  65. # -----------------------------------------------
  66. type UserResponse {
  67. operation: Operation
  68. user: User
  69. }
  70. type UserLastLogin {
  71. id: UUID
  72. name: String
  73. lastLoginAt: Date
  74. }
  75. type UserMinimal {
  76. id: UUID
  77. name: String
  78. email: String
  79. isSystem: Boolean
  80. isActive: Boolean
  81. createdAt: Date
  82. lastLoginAt: Date
  83. }
  84. type User {
  85. id: UUID
  86. name: String
  87. email: String
  88. auth: JSON
  89. isSystem: Boolean
  90. isActive: Boolean
  91. isVerified: Boolean
  92. meta: JSON
  93. prefs: JSON
  94. createdAt: Date
  95. updatedAt: Date
  96. lastLoginAt: Date
  97. groups: [Group]
  98. }
  99. type UserProfile {
  100. id: Int
  101. name: String
  102. email: String
  103. providerKey: String
  104. providerName: String
  105. isSystem: Boolean
  106. isVerified: Boolean
  107. location: String
  108. jobTitle: String
  109. timezone: String
  110. dateFormat: String
  111. appearance: String
  112. createdAt: Date
  113. updatedAt: Date
  114. lastLoginAt: Date
  115. groups: [String]
  116. pagesTotal: Int
  117. }
  118. type UserTokenResponse {
  119. operation: Operation
  120. jwt: String
  121. }
  122. enum UserOrderBy {
  123. id
  124. email
  125. name
  126. createdAt
  127. updatedAt
  128. lastLoginAt
  129. }
  130. input UserUpdateInput {
  131. email: String
  132. name: String
  133. newPassword: String
  134. groups: [UUID!]
  135. isActive: Boolean
  136. isVerified: Boolean
  137. meta: JSON
  138. prefs: JSON
  139. }