T
TanStackโ€ข3y ago
cloudy-cyan

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
rare-sapphireโ€ข3y ago
would be a good feature request I think ๐Ÿ™‚
cloudy-cyan
cloudy-cyanOPโ€ข3y ago
Will create an issue later today. Thanks
rare-sapphire
rare-sapphireโ€ข3y ago
are you up for contributing it, too ?
cloudy-cyan
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
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-cyan
cloudy-cyanOPโ€ข3y ago
I'll try something ๐Ÿ‘
correct-apricot
correct-apricotโ€ข3y ago
Sounds like a great Idea!! Also taking a look ๐Ÿ™ƒ
cloudy-cyan
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.
No description
cloudy-cyan
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...

Did you find this page helpful?