From 65769fc0dd751159e840367ea3393a04dc2e84b8 Mon Sep 17 00:00:00 2001 From: richblack Date: Thu, 16 Apr 2026 16:07:51 +0800 Subject: [PATCH] fix: graphSchema missing ON_SUCCESS edge type + label field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add all valid EdgeTypes to graphSchema.edges.type enum - Add label field to graphSchema.nodes (graph-builder passes it) - Was causing 圖定義產生失敗 for all /cypher/execute calls Co-Authored-By: Claude Sonnet 4.6 --- cypher-executor/src/lib/schemas.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypher-executor/src/lib/schemas.ts b/cypher-executor/src/lib/schemas.ts index 0fe5391..9ebbd0a 100644 --- a/cypher-executor/src/lib/schemas.ts +++ b/cypher-executor/src/lib/schemas.ts @@ -8,12 +8,13 @@ export const graphSchema = z.object({ id: z.string(), type: z.enum(['Input', 'Component', 'Output']), componentId: z.string().optional(), + label: z.string().optional(), data: z.record(z.unknown()).optional(), })), edges: z.array(z.object({ from: z.string(), to: z.string(), - type: z.enum(['PIPE', 'IF', 'FOREACH', 'CONTINUE']), + type: z.enum(['PIPE', 'IF', 'FOREACH', 'CONTINUE', 'IS_A', 'ON_SUCCESS', 'ON_FAIL', 'ON_CLICK', 'CALLS_SUBFLOW', 'CONTAINS', 'HAS_STYLE', 'HAS_BEHAVIOR']), condition: z.string().optional(), iterator: z.string().optional(), })),