php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

Fetch support

Open stevelacey opened this issue 5 years ago • 3 comments

Any plans to support fetch in addition to xhr?

I don't see a way to hook php-debugbar up to Apollo currently, whilst it works just fine with Axios, is lack of fetch support the reason? I came across the docs for manual integration but it seems to be xhr specific and throwing fetch as it doesn't go so well.

Would be great to hook this up to Apollo-based SPA's so I can see the horrendous number of database queries being ran easier 🙃

stevelacey avatar Sep 23 '19 10:09 stevelacey

I think this is what we do now: https://github.com/maximebf/php-debugbar/blob/2a95c20da4c6965114e5773f3aaf974e12f9c92b/src/DebugBar/Resources/debugbar.js#L1151-L1169

And this is how Symfony does it, which supports fetch: https://github.com/symfony/symfony/blob/7788612c3cb63cc44b2cabb4644a7fbd75c61e97/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig#L279-L331

So I think we should be able to support fetch also. Do you want to make a PR for that?

barryvdh avatar Sep 23 '19 13:09 barryvdh

@barryvdh yep, done, please check out #422 🤘

stevelacey avatar Sep 24 '19 09:09 stevelacey

I think this issue can be closed, right?

fjorgemota avatar Mar 11 '20 18:03 fjorgemota

I think this issue can be closed, right?

Yes, must be closed

parallels999 avatar Sep 27 '23 19:09 parallels999