Manipulate a query's data in Devtools
Hi,
wondering: is there a way to manipulate the cached data for a given query from inside the Devtools?
e.g. I want to check my rendering with an empty list, a single item, multiple items or any other shape or form of special returns. Currently changing my mock-server to actually return the data differently. But that needs a restart and refetch etc.
Would be nice being able to change the data displayed inside the Data Explorer part of the devtools manually.
Thanks ๐
9 Replies
rare-sapphireโข3y ago
would be a good feature request I think ๐
cloudy-cyanOPโข3y ago
Will create an issue later today. Thanks
rare-sapphireโข3y ago
are you up for contributing it, too ?
cloudy-cyanOPโข3y ago
I'd love to. Will have to find the time tho -.- Deadline approaching fast and haven't touched any of the codebase of react-query nor the devtools yet.
is the new version of devtools out yet?
Do new features follow some kind of process? Issue for discussions and outlining the features etc.?
Or just a PR with a first draft of how it could work and look like and itterate in there?
rare-sapphireโข3y ago
yeah new version is on the
beta branch (v5). We won't do any new stuff on the old devtools
since we discussed it here, you can try to make a PR and we can discuss some more there.
heads up: the devtools are in solid-js now ๐
cloudy-cyanOPโข3y ago
I'll try something ๐
correct-apricotโข3y ago
Sounds like a great Idea!!
Also taking a look ๐
cloudy-cyanOPโข3y ago
So I managed to build out a first draft with editable fields for string values and also added a delete button next to the copy button.
This is purely visual so far. First time touching Solid as well ๐ Feels familiar.
I'll create a PR tomorrow so we can discuss in there. Will possibly need some advice how to best get the activeQuery and activeQueryStateData into the Explorer and into the right places to set the data on change.

cloudy-cyanOPโข3y ago
GitHub
Feature(Devtools): make data of queries editable by bastibuck ยท Pu...
It would be nice if one could edit data of queries directly inside the devtools without changing the actual return values of a potential mock or real backend running during development.
For example...