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.

101 lines
1.5 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]
  18. search(
  19. query: String!
  20. ): [UserMinimal]
  21. single(
  22. id: Int!
  23. ): User
  24. }
  25. # -----------------------------------------------
  26. # MUTATIONS
  27. # -----------------------------------------------
  28. type UserMutation {
  29. create(
  30. email: String!
  31. name: String
  32. passwordRaw: String
  33. provider: String!
  34. providerId: String
  35. role: UserRole!
  36. ): UserResponse
  37. update(
  38. id: Int!
  39. email: String
  40. name: String
  41. provider: String
  42. providerId: String
  43. role: UserRole
  44. ): UserResponse
  45. delete(
  46. id: Int!
  47. ): DefaultResponse
  48. resetPassword(
  49. id: Int!
  50. ): DefaultResponse
  51. setPassword(
  52. id: Int!
  53. passwordRaw: String!
  54. ): DefaultResponse
  55. }
  56. # -----------------------------------------------
  57. # TYPES
  58. # -----------------------------------------------
  59. enum UserRole {
  60. guest
  61. user
  62. admin
  63. }
  64. type UserResponse {
  65. responseResult: ResponseStatus!
  66. user: User
  67. }
  68. type UserMinimal {
  69. id: Int!
  70. name: String!
  71. email: String!
  72. provider: String!
  73. }
  74. type User {
  75. id: Int!
  76. name: String!
  77. email: String!
  78. provider: String!
  79. providerId: String
  80. role: UserRole!
  81. createdAt: Date!
  82. updatedAt: Date!
  83. groups: [Group]
  84. }