|
2 | 2 | // Minimal GraphQL routing — parses { "query": "...", "variables": {} } and |
3 | 3 | // dispatches by query-substring to backend HTTP calls. Matches the V gateway's |
4 | 4 | // field-routing approach: not a full GraphQL parser, but enough to expose |
5 | | -// health / telemetry / octads / driftScore / executeVql. |
| 5 | +// health / telemetry / octads / driftScore / executeVcl. |
6 | 6 |
|
7 | 7 | const std = @import("std"); |
8 | 8 | const Config = @import("config.zig").Config; |
@@ -93,30 +93,30 @@ pub fn handle( |
93 | 93 | } |
94 | 94 | } |
95 | 95 |
|
96 | | - // executeVql mutation |
97 | | - if (std.mem.indexOf(u8, query, "executeVql") != null or |
| 96 | + // executeVcl mutation |
| 97 | + if (std.mem.indexOf(u8, query, "executeVcl") != null or |
98 | 98 | std.mem.indexOf(u8, query, "mutation") != null) |
99 | 99 | { |
100 | | - const vql_val = variables.get("query") orelse { |
101 | | - return errorBody(allocator, 200, "VQL mutation requires variables.query"); |
| 100 | + const vcl_val = variables.get("query") orelse { |
| 101 | + return errorBody(allocator, 200, "VCL mutation requires variables.query"); |
102 | 102 | }; |
103 | | - if (vql_val != .string) { |
| 103 | + if (vcl_val != .string) { |
104 | 104 | return errorBody(allocator, 200, "variables.query must be a string"); |
105 | 105 | } |
106 | | - const payload = try std.fmt.allocPrint(allocator, "{{\"query\":\"{s}\"}}", .{vql_val.string}); |
| 106 | + const payload = try std.fmt.allocPrint(allocator, "{{\"query\":\"{s}\"}}", .{vcl_val.string}); |
107 | 107 | defer allocator.free(payload); |
108 | | - const url = try std.fmt.allocPrint(allocator, "{s}/vql/execute", .{cfg.rust_url}); |
| 108 | + const url = try std.fmt.allocPrint(allocator, "{s}/vcl/execute", .{cfg.rust_url}); |
109 | 109 | defer allocator.free(url); |
110 | 110 | if (proxy.postJson(allocator, url, payload)) |r| { |
111 | 111 | defer allocator.free(r.body); |
112 | 112 | const out = try std.fmt.allocPrint( |
113 | 113 | allocator, |
114 | | - "{{\"data\":{{\"executeVql\":{s}}}}}", |
| 114 | + "{{\"data\":{{\"executeVcl\":{s}}}}}", |
115 | 115 | .{r.body}, |
116 | 116 | ); |
117 | 117 | return .{ .status = 200, .body = out }; |
118 | 118 | } else |_| { |
119 | | - return dataNull(allocator, "executeVql", "VQL execution failed"); |
| 119 | + return dataNull(allocator, "executeVcl", "VCL execution failed"); |
120 | 120 | } |
121 | 121 | } |
122 | 122 |
|
@@ -150,7 +150,7 @@ pub fn handle( |
150 | 150 | return errorBody( |
151 | 151 | allocator, |
152 | 152 | 200, |
153 | | - "Unrecognised query. Supported: health, telemetry, octads, driftScore, executeVql", |
| 153 | + "Unrecognised query. Supported: health, telemetry, octads, driftScore, executeVcl", |
154 | 154 | ); |
155 | 155 | } |
156 | 156 |
|
|
0 commit comments