question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

individual array entries for query key path

See original GitHub issue

Describe the feature you’d like to request

change query key shape so you can invalidate entire routers

Describe the solution you’d like to see

["todo.detail.get",1] 
--> 
["todo", "detail", "get",1] 

["todo.list.get", { done: true }]
--> 
["todo", "list", "get", { done: true }]

This way you can invalidate entire routers too:

utils.todo.invalidate()
utils.todo.list.invalidate()

suggested by @TkDodo in the Discord: https://discord.com/channels/867764511159091230/1014458860355981332/1014505247902797886

Desribe alternate solutions

none

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I’d be down to file a PR implementing this feature!

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
JonPartoncommented, Oct 6, 2022

Thanks for circling back round with positive feedback @TkDodo!! It is appreciated and glad it’s working well for you!! 😊

1reaction
TkDodocommented, Oct 6, 2022

thank you so much for this feature - it works perfectly ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Work with arrays | BigQuery - Google Cloud
With Google Standard SQL, you can construct array literals, build arrays from subqueries using the ARRAY function, and aggregate values into an array...
Read more >
javascript - Find by key deep in a nested array - Stack Overflow
I updated the function to account for property arrays: ... deepSearchItems(object[Object.keys(object)[i]], key, predicate); if (o != null && o instanceof ...
Read more >
Query an Array of Embedded Documents — MongoDB Manual
This page provides examples of query operations on an array of nested documents using the db.collection.find() method in mongosh . The examples on...
Read more >
Query Keys | TanStack Query Docs
Query keys have to be an Array at the top level, and can be as simple as an Array with a single string,...
Read more >
JSONPath Syntax | AlertSite Documentation
Selects array elements with the specified indexes. Returns a list. ..property, Recursive descent: Searches for the specified property name ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found