lrj
8 小时以前 ae3349d2ff53767b5bc9cb30e1bf7e15f9e814ee
backend/src/main/resources/graphql/tag.graphqls
@@ -1,8 +1,34 @@
# 标签相关的GraphQL扩展
extend type Query {
    "获取所有标签"
    tags: [TagResponse]
# 标签相关的GraphQL Schema定义
    
    "根据分类获取标签"
    tagsByCategory(category: String): [TagResponse]
# 标签输入类型
input TagInput {
    id: Long
    name: String!
    category: String
    description: String
    state: Int
}
# 扩展查询类型
extend type Query {
    # 获取所有标签
    tags: [TagResponse!]!
    # 根据分类获取标签
    tagsByCategory(category: String!): [TagResponse!]!
    # 根据ID获取标签详情
    tag(id: Long!): TagResponse
    # 根据名称模糊查询标签
    tagsByName(name: String!): [TagResponse!]!
}
# 扩展变更类型
extend type Mutation {
    # 保存标签(新增或更新)
    saveTag(input: TagInput!): TagResponse!
    # 删除标签
    deleteTag(id: Long!): Boolean!
}