group.graphql 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # ===============================================
  2. # GROUPS
  3. # ===============================================
  4. extend type Query {
  5. groups(
  6. filter: String
  7. orderBy: String
  8. ): [Group]
  9. groupById(
  10. id: Int!
  11. ): Group
  12. }
  13. extend type Mutation {
  14. createGroup(
  15. name: String!
  16. ): GroupResponse
  17. updateGroup(
  18. id: Int!
  19. patch: GroupUpdateInput!
  20. ): DefaultResponse
  21. deleteGroup(
  22. id: Int!
  23. ): DefaultResponse
  24. assignUserToGroup(
  25. groupId: Int!
  26. userId: Int!
  27. ): DefaultResponse
  28. unassignUserFromGroup(
  29. groupId: Int!
  30. userId: Int!
  31. ): DefaultResponse
  32. }
  33. # -----------------------------------------------
  34. # TYPES
  35. # -----------------------------------------------
  36. type GroupResponse {
  37. operation: Operation
  38. group: Group
  39. }
  40. type Group {
  41. id: Int
  42. name: String
  43. isSystem: Boolean
  44. redirectOnLogin: String
  45. permissions: [String]
  46. pageRules: [PageRule]
  47. users: [UserMinimal]
  48. createdAt: Date
  49. updatedAt: Date
  50. }
  51. type PageRule {
  52. id: String
  53. deny: Boolean
  54. match: PageRuleMatch
  55. roles: [String]
  56. path: String
  57. locales: [String]
  58. }
  59. input GroupUpdateInput {
  60. name: String!
  61. redirectOnLogin: String!
  62. permissions: [String]!
  63. pageRules: [PageRuleInput]!
  64. }
  65. input PageRuleInput {
  66. id: String!
  67. deny: Boolean!
  68. match: PageRuleMatch!
  69. roles: [String]!
  70. path: String!
  71. locales: [String]!
  72. }
  73. enum PageRuleMatch {
  74. START
  75. EXACT
  76. END
  77. REGEX
  78. TAG
  79. }