apollo-server
apollo-server copied to clipboard
Add request data to `invalidRequestWasReceived` lifecycle event
Hi,
I want to log all request made to my API and I'm not satisfied by the didEncounterErrors
because it discards Bad Request event and such.
By adding more the request object to invalidRequestWasReceived
, I will be able to log information regarding the malformed request such as body and headers that will help me trouble shoot issues.
To give a concrete example, I currently have my API that is consumed by several client but one of them is intermittently spawning a lot of Bad Request issue. By having the ability to log all requests along with their headers and body content, I will be capable of identify the client that's causing the Bad Request.