Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent executing queries twice #12

Merged
merged 1 commit into from
Aug 28, 2021
Merged

Prevent executing queries twice #12

merged 1 commit into from
Aug 28, 2021

Conversation

bellini666
Copy link
Contributor

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
Copy link

codecov-io commented May 1, 2020

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
Copy link
Contributor Author

@flavors any chance to get this reviewed?

@vramos1
Copy link

vramos1 commented Aug 26, 2020

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

@diegobordeu
Copy link

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

@jrd
Copy link

jrd commented Aug 31, 2020

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…

Copy link

@vberlier vberlier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patiently waiting for this to be merged 👀 🤞

@mohit-deepsource
Copy link

@mongkok Please take a look at this

@BioRazor
Copy link

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
Copy link

@mongkok Please merge this PR

@mongkok mongkok merged commit a04794b into flavors:master Aug 28, 2021
@mongkok
Copy link
Member

mongkok commented Aug 28, 2021

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"mutate" method of Mutation executes twice.
10 participants