Refactor GraphQL schema and format JSON output

This commit is contained in:
2023-11-20 08:51:07 +08:00
parent 5075515e37
commit a22c4e8bf6
2 changed files with 69 additions and 25 deletions

View File

@@ -197,7 +197,8 @@ func main() {
http.Error(w, result.Errors[0].Error(), 500)
return
}
rJSON, _ := json.Marshal(result)
// 格式化输出
rJSON, _ := json.MarshalIndent(result, "", " ")
fmt.Printf("%s \n", rJSON)
w.Write(rJSON)
})