user.graphql 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. providerKey: String
  43. providerId: String
  44. ): UserResponse @auth(requires: ["manage:users", "manage:system"])
  45. delete(
  46. id: Int!
  47. ): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
  48. resetPassword(
  49. id: Int!
  50. ): DefaultResponse
  51. setPassword(
  52. id: Int!
  53. passwordRaw: String!
  54. ): DefaultResponse
  55. }
  56. # -----------------------------------------------
  57. # TYPES
  58. # -----------------------------------------------
  59. type UserResponse {
  60. responseResult: ResponseStatus!
  61. user: User
  62. }
  63. type UserMinimal {
  64. id: Int!
  65. name: String!
  66. email: String!
  67. providerKey: String!
  68. isSystem: Boolean!
  69. createdAt: Date!
  70. }
  71. type User {
  72. id: Int!
  73. name: String!
  74. email: String!
  75. providerKey: String!
  76. providerId: String
  77. isSystem: Boolean!
  78. location: String!
  79. jobTitle: String!
  80. timezone: String!
  81. createdAt: Date!
  82. updatedAt: Date!
  83. groups: [Group]!
  84. }