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.

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