New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expose querykey getter and fix some querykey stuff #3302
Merged
Merged
Changes from 20 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
5392463
1
juliusmarminge 8638767
Merge branch 'main' into julius/querykeys
juliusmarminge bc702cc
2
juliusmarminge 5b55386
add some tests
juliusmarminge 2711978
failing test
juliusmarminge 30dcc40
simplify
juliusmarminge d77f3c8
going places
juliusmarminge 36ffd96
docs
juliusmarminge 0a97a6b
more docs
juliusmarminge 217db37
revert example
juliusmarminge 964da9c
docs 3
juliusmarminge 90a9173
add test
juliusmarminge dc92dcf
fix test
juliusmarminge 5813e19
restructure
juliusmarminge 366107d
revert lock
juliusmarminge c1d4497
better brackets
juliusmarminge c909673
better docs
juliusmarminge 4efa3a8
fixy
juliusmarminge 778859d
please not now docu
juliusmarminge 7770be8
imports
juliusmarminge e9f03e1
Merge branch 'main' into julius/querykeys
juliusmarminge cca2d30
move it to trpc object instead
juliusmarminge 8b937df
docs
juliusmarminge c9b59bd
simplify test setup
juliusmarminge 44179fd
make optional
juliusmarminge 2d25187
add test outside react
juliusmarminge d06701a
add example
juliusmarminge 4b4e12f
fix
juliusmarminge 377e271
fix2
juliusmarminge c8b8ee8
docs and remove example
juliusmarminge cdc5808
Merge branch 'main' into julius/querykeys
juliusmarminge dd8062e
revert downgrade of docusaurus
juliusmarminge 04d5333
Merge branch 'main' into julius/querykeys
juliusmarminge c92eb39
Merge branch 'main' into julius/querykeys
juliusmarminge c1b162e
qc -> queryClient
juliusmarminge c8e3ed7
mby???
juliusmarminge 0e519e2
patch querykey
juliusmarminge 60afce2
fix invalidate
juliusmarminge 72b5ab6
fix old
juliusmarminge 6f195da
regression tests
juliusmarminge d60dea3
testid
juliusmarminge f566339
Merge remote-tracking branch 'origin/main' into julius/querykeys
juliusmarminge 5adc7ec
fix
juliusmarminge 957a78c
interop
juliusmarminge f025343
Merge branch 'main' into julius/querykeys
juliusmarminge 3ceba17
disable interop
juliusmarminge 05f5c8d
comment
juliusmarminge 88b8052
1 more test
juliusmarminge 943fdeb
fix the interop stuff
juliusmarminge bb26bc1
eeh
juliusmarminge 1396478
Merge branch 'main' into julius/querykeys
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my phone so I might be missing something, but wouldn't it make sense to have both arguments optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cc @TkDodo wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we default to? "query"?
The input would be optional if the procedure's input is optional, but we need the type (I wrote a bit about this up top or in discord with @sachinraja)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's getting the key for sale of invalidation or resetting,
any
is a good defaultIf its for getting or changing the cache
any
might not be the bestThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is
"any"
going to return? does it match bothquery
andinfinite
? If so I think it would be a good default forgetQueryKey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any
returns the query key without the type object in the key, so as long as fuzzy matching is enabled for the methods then it will match both!Do all methods match fuzzy? Or do the "query" versions only match exact? This may need some documentation on our side!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all methods can, but it's not the default everywhere. Generally speaking:
getQueriesData
,invalidateQueries
orsetQueriesDefault
getQueryData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fuzzy matching behaviour queried above for
xxxxxQuery
type methods also effects if theinput
param should be optional!... Although I think it should be as I know some deffinitely fuzzy match!(P. S. My phone hadn't updated before TkDodo replied above!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmn this may mean making things optional / default to a query key of
any
for the main path I expect this being used for (we provide many of the tanstack methods for individual queries already so this is likely to be used in the fuzzy matching ones!) but then put some good documentation on this noting the gotcha between needing exact keys for methods that are namedxxxxxQuery