flavors / django-graphiql-debug-toolbar

Django Debug Toolbar for GraphiQL IDE and Graphene
https://pypi.python.org/pypi/django-graphiql-debug-toolbar
MIT License
72 stars 23 forks source link

Prevent executing queries twice #12

Closed bellini666 closed 3 years ago

bellini666 commented 4 years ago

Fix #9

I didn't want to rewrite the whole debug toolbar's logic so I wrote this to monkey patched the toolbar to be able to retrieve it after super is called, that way we don't need to instantiate another toolbar and process the response again.

codecov-io commented 4 years ago

Codecov Report

Merging #12 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #12   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           65        72    +7     
  Branches        11         9    -2     
=========================================
+ Hits            65        72    +7     
Impacted Files Coverage Δ
graphiql_debug_toolbar/middleware.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 501a440...3664680. Read the comment docs.

bellini666 commented 4 years ago

@flavors any chance to get this reviewed?

vramos1 commented 4 years ago

please could it be reviewed? It could be very usefull, im facing the same problem here

diegobordeu commented 4 years ago

same problem here!! hopefully this PR reviewed soon !!!

jrd commented 4 years ago

Can this PR get merged please?

As of now, the debug toolbar is unusable with graphql when making mutation requests. It's slower for query requests without impact, but it has HUGE impact when doing mutations (create, update, …).

The debug toolbar is supposed to help, not create more problems…

mohit-deepsource commented 4 years ago

@mongkok Please take a look at this

BioRazor commented 4 years ago

I have the same problem, I wasted hours looking for what it was.

Our friend DebugToolbar instead of solving problems generated a new one. I will wait for this PR!

eikichi18 commented 3 years ago

@mongkok Please merge this PR

mongkok commented 3 years ago

Thanks for this PR, monkey patch is the best approach.

The DebugToolbar created using functools.partial does not allow class methods, e.g. DebugToolbar.is_toolbar_request(), I will add minor changes to support new django-debug-toolbar releases.

@bellini666 thanks for your help here and for keeping this package alive.

bellini666 commented 3 years ago

Thanks for mergint and releasing a new working version @mongkok :)