Log apollo-server GraphQL query and variables per request
问题 When using apollo-server 2.2.1 or later, how can one log, for each request, the query and the variables? This seems like a simple requirement and common use case, but the documentation is very vague, and the query object passed to formatResponse no longer has the queryString and variables properties. 回答1: Amit's answer works (today), but IMHO it is a bit hacky and it may not work as expected in the future, or it may not work correctly in some scenarios. For instance, the first thing that I