Better logging around GraphQL API usage
Created by: slimsag
Right now, it is possible to construct very heavy GraphQL API queries that harm Sourcegraph (I have opened a separate issue for us to prevent this, see https://github.com/sourcegraph/sourcegraph/issues/5705 ) and we currently do not have any way to identify exactly which queries those were. Today we log:
- That a GraphQL query was made (but no information about it), but only after it completed.
- How long the GraphQL query took, but only after it completed.
With such queries, the above log lines do not even print, so it is impossible to identify what queries might have caused an issue. We should be logging:
- The authenticated user, if any.
- The GraphQL query string (without this, I don't see how we could debug such situations).