fix: double config path, stale service worker, empty op-name log
- main.go: DOCKER_PATH=/config + /config.json (was /config/config.json)
- vite.config.ts: skipWaiting+clientsClaim forces new SW immediately;
navigateFallback: null prevents SW from serving stale index.html;
globPatterns excludes HTML so navigation always hits the network
- server.go: gqlOpName handles shorthand { field } syntax
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -253,13 +253,18 @@ func writeGQLError(w http.ResponseWriter, msg string) {
|
||||
|
||||
func gqlOpName(query string) string {
|
||||
q := strings.TrimSpace(query)
|
||||
if strings.HasPrefix(q, "mutation") {
|
||||
return "mutation " + firstWord(q[len("mutation"):])
|
||||
switch {
|
||||
case strings.HasPrefix(q, "mutation"):
|
||||
return "mutation " + firstWord(strings.TrimSpace(q[len("mutation"):]))
|
||||
case strings.HasPrefix(q, "query"):
|
||||
return "query " + firstWord(strings.TrimSpace(q[len("query"):]))
|
||||
case strings.HasPrefix(q, "{"):
|
||||
// Shorthand query: extract first field name from { field ... }
|
||||
inner := strings.TrimSpace(q[1:])
|
||||
return "query {" + firstWord(inner) + "...}"
|
||||
default:
|
||||
return firstWord(q)
|
||||
}
|
||||
if strings.HasPrefix(q, "query") {
|
||||
return "query " + firstWord(q[len("query"):])
|
||||
}
|
||||
return firstWord(q)
|
||||
}
|
||||
|
||||
func firstWord(s string) string {
|
||||
|
||||
Reference in New Issue
Block a user