From cacf02681bfdda7926379d37d58ad1a21e398e1a Mon Sep 17 00:00:00 2001
From: lrj <owen.stl@gmail.com>
Date: 星期六, 04 十月 2025 19:08:12 +0800
Subject: [PATCH] fix(auth): 对无 Authorization 的 GraphQL 请求默认匿名放行到解析层,避免 400/403;公开查询仍优先识别后放行

---
 backend/src/main/resources/graphql/tag.graphqls |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/backend/src/main/resources/graphql/tag.graphqls b/backend/src/main/resources/graphql/tag.graphqls
index 9b337f4..014c0b1 100644
--- a/backend/src/main/resources/graphql/tag.graphqls
+++ b/backend/src/main/resources/graphql/tag.graphqls
@@ -1,8 +1,34 @@
-# 鏍囩鐩稿叧鐨凣raphQL鎵╁睍
+# 鏍囩鐩稿叧鐨凣raphQL Schema瀹氫箟
+
+# 鏍囩杈撳叆绫诲瀷
+input TagInput {
+    id: Long
+    name: String!
+    category: String
+    description: String
+    state: Int
+}
+
+# 鎵╁睍鏌ヨ绫诲瀷
 extend type Query {
-    "鑾峰彇鎵�鏈夋爣绛�"
-    tags: [TagResponse]
+    # 鑾峰彇鎵�鏈夋爣绛�
+    tags: [TagResponse!]!
     
-    "鏍规嵁鍒嗙被鑾峰彇鏍囩"
-    tagsByCategory(category: String): [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!
 }
\ No newline at end of file

--
Gitblit v1.8.0