1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| # 角色相关的GraphQL Schema定义
|
| # 角色响应类型
| type RoleResponse {
| id: Long!
| code: String!
| name: String!
| description: String
| state: Int!
| createTime: String
| updateTime: String
| }
|
| # 角色输入类型
| input RoleInput {
| id: Long
| code: String!
| name: String!
| description: String
| state: Int
| }
|
| # 扩展查询类型
| extend type Query {
| # 获取所有角色列表
| roles: [RoleResponse!]!
|
| # 获取所有启用状态的角色
| activeRoles: [RoleResponse!]!
|
| # 根据ID获取角色详情
| role(id: Long!): RoleResponse
|
| # 根据角色代码获取角色
| roleByCode(code: String!): RoleResponse
|
| # 根据状态获取角色
| rolesByState(state: Int!): [RoleResponse!]!
|
| # 根据名称模糊查询角色
| rolesByName(name: String!): [RoleResponse!]!
| }
|
| # 扩展变更类型
| extend type Mutation {
| # 保存角色(新增或更新)
| saveRole(input: RoleInput!): RoleResponse!
|
| # 删除角色
| deleteRole(id: Long!): Boolean!
| }
|
|