urql-graphql / urql-devtools

A tool for monitoring and debugging urql during development
https://formidable.com/open-source/urql/docs/advanced/debugging/#devtools
MIT License
257 stars 11 forks source link

fix: reset code snippet when try to append a new code #352

Closed ValGeorgiev closed 3 years ago

ValGeorgiev commented 3 years ago

The solution: Clean the code section before appending new clicked query. We first check if there are some child nodes and if there are, we remove them and append the new code. It's strange that there are methods for getting firstChild, all children or parent element, but there is no method for cleaning html code inside the node.

Root cause: The main issue was that we are replace only the first child, which is one of many inside the node.

Issue: https://github.com/FormidableLabs/urql-devtools/issues/351

Video after the fix:

https://user-images.githubusercontent.com/12056467/115618244-1b184b00-a2fb-11eb-89ec-5642f24bd387.mov