实装 graphql

This commit is contained in:
2023-11-21 04:10:39 +08:00
parent 690dc974eb
commit 0bb90303cb
2 changed files with 213 additions and 160 deletions

View File

@@ -27,9 +27,9 @@ func main() {
http.Error(w, result.Errors[0].Error(), 500)
return
}
rJSON, _ := json.MarshalIndent(result, "", " ")
rJSON, _ := json.MarshalIndent(result.Data, "", " ")
w.Write(rJSON)
})
fmt.Println("Now server is running on port 6001")
http.ListenAndServe(":6001", nil)
}