group.graphql 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # ===============================================
  2. # GROUPS
  3. # ===============================================
  4. extend type Query {
  5. groups: GroupQuery
  6. }
  7. extend type Mutation {
  8. groups: GroupMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type GroupQuery {
  14. list(
  15. filter: String
  16. orderBy: String
  17. ): [Group]
  18. }
  19. # -----------------------------------------------
  20. # MUTATIONS
  21. # -----------------------------------------------
  22. type GroupMutation {
  23. create(
  24. name: String!
  25. ): GroupResponse
  26. update(
  27. id: Int!
  28. name: String!
  29. ): GroupResponse
  30. delete(
  31. id: Int!
  32. ): DefaultResponse
  33. assignUser(
  34. groupId: Int!
  35. userId: Int!
  36. ): DefaultResponse
  37. unassignUser(
  38. groupId: Int!
  39. userId: Int!
  40. ): DefaultResponse
  41. }
  42. # -----------------------------------------------
  43. # TYPES
  44. # -----------------------------------------------
  45. type GroupResponse {
  46. operation: ResponseStatus!
  47. group: Group
  48. }
  49. type Group {
  50. id: Int!
  51. name: String!
  52. rights: [String]
  53. users: [User]
  54. createdAt: Date!
  55. updatedAt: Date!
  56. }