apollo-server icon indicating copy to clipboard operation
apollo-server copied to clipboard

Add request data to `invalidRequestWasReceived` lifecycle event

Open Masadow opened this issue 3 weeks ago • 3 comments

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.

Masadow avatar Jun 10 '24 16:06 Masadow