Closed ar7n closed 3 years ago
I've ran into the same issue although it appears to be all calls not just mutations.
As far as I can tell the request is being processed in these 2 locations: https://github.com/flavors/django-graphiql-debug-toolbar/blob/master/graphiql_debug_toolbar/middleware.py#L61 https://github.com/flavors/django-graphiql-debug-toolbar/blob/master/graphiql_debug_toolbar/middleware.py#L80
Yup, can confirm.
Same here
same here
@ar7n are you accepting PRs?
@dvf i am not maintainer 🤷♂️
Hey @dvf , if you have a solution, can you please share it with us? Thanks a lot.
Sorry @ar7n, my mistake.
@ulgens, I haven't had time to dig in. But on these lines it looks like we're initially processing the request in order to:
POST
request from a GraphQL view.So the response is called twice, first to get the JS to display on the page, and second to return the metrics to display. Perhaps @mongkok could shed some light on how to fix this.
Just want to bump this @mongkok
@dvf https://gist.github.com/ulgens/e166ad31ec71e6b1f0777a8d81ce48ae I created this for one of our projects. The code doesn't look good to me and i'm surprised it works but what i try achieve is, basically there are two cases to render panel context: Get request to html file (page load) and json post request (graphl queries). There were two request processor in the original code and i tried to isolate these two cases and put related queries under them. It works for both page load and json post requests, doesn't duplicate queries or mutations and returns correct data.
is there a fix to this?
@adrengifo the patch proposed by @ulgens in his Gist works good.
It is definitely not a production-grade workflow, but since the debug toolbar is only meant to be used during development, that's enough for me as long as the underlying issue is not fixed. Thanks @ulgens!
I just opened a PR that should solve this: https://github.com/flavors/django-graphiql-debug-toolbar/pull/12
I thought about copying the whole toolbar's __call__
code and return a tuple of (response, toolbar)
to avoid needing to instantiate and process the response again. To avoid that (which would overwrite any change in the toolbar's code itself), I mocked the toolbar's instantiation in kinda malignus way but functional =P
What do you guys think?
any news about this issue?
is this project not longer maintained? I'm facing the same issue here and I see there is already a PR since a couple month ago but is not merged yet
I have the issue too. To quick fix I suggested to role back to the main debug toolbar
.
Damn, had this issue for straight 1 month of Development. I just moved back to the default debug toolbar
I just opened a PR that should solve this: #12
I thought about copying the whole toolbar's
__call__
code and return a tuple of(response, toolbar)
to avoid needing to instantiate and process the response again. To avoid that (which would overwrite any change in the toolbar's code itself), I mocked the toolbar's instantiation in kinda malignus way but functional =PWhat do you guys think?
Great job Man, I don't know why your PR haven't been reviewed. @mongkok Please can you take a look?
dependencies
code
log