-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(GraphQL): Rename logRequest name and its resolver. (#8388)
## Problem In order to add GraphQL Query Log(#8305) we need to rename the current DQL query log resolver and config. ## Solution > Rename: logRequest => logDQLRequest Important change: ```diff --- glog.Infof("Got a query: %+v", req.req) +++ glog.Infof("Got a DQL query: %+v", req.req) ```
- Loading branch information
Showing
6 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1188,8 +1188,8 @@ func (s *Server) doQuery(ctx context.Context, req *Request) (resp *api.Response, | |
return nil, serverOverloadErr | ||
} | ||
|
||
if bool(glog.V(3)) || worker.LogRequestEnabled() { | ||
glog.Infof("Got a query: %+v", req.req) | ||
if bool(glog.V(3)) || worker.LogDQLRequestEnabled() { | ||
glog.Infof("Got a DQL query: %+v", req.req) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
MichelDiz
Author
Contributor
|
||
} | ||
|
||
isGraphQL, _ := ctx.Value(IsGraphql).(bool) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Because this shows in the logs, it sounds like the server "got a DQL query" but in fact the server may have received a GraphQL query who's DQL form is in req.req.
I suggest rewording this to "Got a query. DQL form: %+v" to clarify that we are viewing the DQL form, but any query will be logged here including GraphQL.