graphiti-api / graphiti

Stylish Graph APIs
https://www.graphiti.dev/
MIT License
960 stars 138 forks source link

Show includes for sideloads in debugger #462

Closed bebbs closed 4 months ago

bebbs commented 4 months ago

Could the debugger show the include key in its output? It caused me some confusion as it wasn't showing up in the logs, but the data was being sideloaded with the include as I'd expect.

Before:

=== Graphiti Debug
Top Level Data Retrieval (+ sideloads):
VehicleResource.all({:filter=>{:id=>"car_123"}, :include=>"cheapest_used_cash_deal", :pagination_links=>true})
Took: 33.59ms
    \_ cheapest_used_cash_deal
       DealResource.all({:filter=>{:type=>"CASH"}, :sort=>"price"})
       Took: 1164.34ms

After:

=== Graphiti Debug
Top Level Data Retrieval (+ sideloads):
VehicleResource.all({:filter=>{:id=>"car_123"}, :include=>"cheapest_used_cash_deal", :pagination_links=>true})
Took: 44.45ms
    \_ cheapest_used_cash_deal
       DealResource.all({:filter=>{:type=>"CASH"}, :include=>"vehicle", :sort=>"price"})
       Took: 971.99ms
jkeen commented 4 months ago

This makes a lot of sense to me—this has bitten me before as well.