You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.0 KiB

  1. # ===============================================
  2. # USERS
  3. # ===============================================
  4. extend type Query {
  5. users: UserQuery
  6. }
  7. extend type Mutation {
  8. users: UserMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type UserQuery {
  14. list(
  15. filter: String
  16. orderBy: String
  17. ): [UserMinimal] @auth(requires: ["write:users", "manage:users", "manage:system"])
  18. search(
  19. query: String!
  20. ): [UserMinimal] @auth(requires: ["write:groups", "manage:groups", "write:users", "manage:users", "manage:system"])
  21. single(
  22. id: Int!
  23. ): User @auth(requires: ["manage:users", "manage:system"])
  24. }
  25. # -----------------------------------------------
  26. # MUTATIONS
  27. # -----------------------------------------------
  28. type UserMutation {
  29. create(
  30. email: String!
  31. name: String!
  32. passwordRaw: String
  33. providerKey: String!
  34. groups: [Int]!
  35. mustChangePassword: Boolean
  36. sendWelcomeEmail: Boolean
  37. ): UserResponse @auth(requires: ["write:users", "manage:users", "manage:system"])
  38. update(
  39. id: Int!
  40. email: String
  41. name: String
  42. newPassword: String
  43. groups: [Int]
  44. location: String
  45. jobTitle: String
  46. timezone: String
  47. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  48. delete(
  49. id: Int!
  50. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  51. resetPassword(
  52. id: Int!
  53. ): DefaultResponse
  54. }
  55. # -----------------------------------------------
  56. # TYPES
  57. # -----------------------------------------------
  58. type UserResponse {
  59. responseResult: ResponseStatus!
  60. user: User
  61. }
  62. type UserMinimal {
  63. id: Int!
  64. name: String!
  65. email: String!
  66. providerKey: String!
  67. isSystem: Boolean!
  68. createdAt: Date!
  69. }
  70. type User {
  71. id: Int!
  72. name: String!
  73. email: String!
  74. providerKey: String!
  75. providerId: String
  76. isSystem: Boolean!
  77. isActive: Boolean!
  78. isVerified: Boolean!
  79. location: String!
  80. jobTitle: String!
  81. timezone: String!
  82. createdAt: Date!
  83. updatedAt: Date!
  84. groups: [Group]!
  85. }