I'm trying to detect n + 1 issue(s) in a Ruby on Rails + GraphQL API created by my predesessor.
Firstly, I tried famous bullet
gem which logs warning when n + 1 issue occurs. However, it doesn't log GraphQL query body. It only logs HTTP method and endpoint, which is always /graphql
. So I found it's useless in this case.
The only choice I can come up with is to watch every log and find duplicate SQL queries. But that's a too much of a hassle and I feel like there has to be a more efficient way of doing that.
I would really appreciate it, if you would share some ideas.