Skip to content

fix(types): prefetchQuery#633

Closed
kizivat wants to merge 3 commits intoTanStack:masterfrom
kizivat:master
Closed

fix(types): prefetchQuery#633
kizivat wants to merge 3 commits intoTanStack:masterfrom
kizivat:master

Conversation

@kizivat
Copy link
Copy Markdown
Contributor

@kizivat kizivat commented Jun 25, 2020

No description provided.

@wolverineks
Copy link
Copy Markdown
Contributor

its not valid to have 2 optional parameters in a row

@wolverineks
Copy link
Copy Markdown
Contributor

my initial thought (just get it done), copy and paste all the function definitions and manually define each possible combination
but there are a bunch now, even the query function is optional, only the queryKey is required

Comment thread types/index.d.ts Outdated
Comment thread types/index.d.ts Outdated
Comment thread types/index.d.ts Outdated
Comment thread types/index.d.ts Outdated
Comment thread types/index.d.ts Outdated
@wolverineks
Copy link
Copy Markdown
Contributor

i think 2 of the function overloads might be duplicates

@kizivat
Copy link
Copy Markdown
Contributor Author

kizivat commented Jun 25, 2020

Co-authored-by: Kevin Sullivan <wolverine.ks@gmail.com>
@wolverineks wolverineks mentioned this pull request Jun 25, 2020
Co-authored-by: Kevin Sullivan <wolverine.ks@gmail.com>
@wolverineks
Copy link
Copy Markdown
Contributor

wolverineks commented Jun 25, 2020

if you dont pass in the 1st optional argument, but do pass in the 2nd, then the 2nd argument is in the wrong place
you would have to use an undefined placeholder like prefetch(queryKey, queryFunction, undefined, prefetchOptions)

so maybe its valid, but i try to avoid it

plus, tanner already put in the code needed to make it work without the placeholder
https://discord.com/channels/719702312431386674/719702452861009930/725511890196889721

@wolverineks
Copy link
Copy Markdown
Contributor

can you move these into the other PR
https://github.blog/2018-10-16-future-of-software/#suggested-changes-public-beta

@kizivat
Copy link
Copy Markdown
Contributor Author

kizivat commented Jun 25, 2020

can you move these into the other PR
https://github.blog/2018-10-16-future-of-software/#suggested-changes-public-beta

I tried to but it doesn't seem I can comment or make suggestions outside of a very narrow context of the lines that were changed in the PR

@kizivat
Copy link
Copy Markdown
Contributor Author

kizivat commented Jun 25, 2020

plus, tanner already put in the code needed to make it work without the placeholder
https://discord.com/channels/719702312431386674/719702452861009930/725511890196889721

What server is this please? I'm not in it.

@kizivat
Copy link
Copy Markdown
Contributor Author

kizivat commented Jun 25, 2020

@wolverineks As for the two optionals:

I see what you're saying and definitely agree. However, as I'm looking into the implementation it doesn’t look like you could get away with passing the prefetch options (e.g. the { force, throwOnError } obj, as the third argument.

https://github.com/tannerlinsley/react-query/blob/ce25ffa5dac431ca4cf965b3f99c5efb519a97b2/src/queryCache.js#L239

In the above line the queryArgs(args) would return the obj into the config var, thus it wouldn't work as expected. At least that's how I see it. Correct me if I'm wrong.

@tannerlinsley
Copy link
Copy Markdown
Member

You'll need to dive into the getQueryArgs function to see how it remaps some things.

@kizivat
Copy link
Copy Markdown
Contributor Author

kizivat commented Jun 25, 2020

Yeah, I see now. Now that that's clear to me and there are some changes around those lines in the original PR, I'll do the suggestions there and close this PR afterwards.

@kizivat kizivat closed this Jun 25, 2020
GEREGUR pushed a commit to GEREGUR/query that referenced this pull request Feb 17, 2026
* style: enhance code block appearance and add title support

* style: improve code block layout and enhance copy notification

* style: update CodeBlock title display and add code metadata extraction

* style: enhance CodeBlock styling and improve background colors

* style: refactor imports in processor.ts for improved readability

* Better llms.txt

* Add powersync to partners

* fix ai landing

* fix auto theme, add single showcase vieo

* fix feedback context

* Squashed commit of the following:

commit 3799edeb5efe17758dcaf5f3c72a9503d8366b39
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Thu Jan 8 08:25:49 2026 -0700

    update post status

commit ddf111301b69fdc6191e7120ea881fe3c018399b
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Thu Jan 8 01:33:10 2026 -0700

    Squashed commit of the following:

    commit 44ea8a0
    Author: Tanner Linsley <tannerlinsley@gmail.com>
    Date:   Thu Jan 8 01:31:30 2026 -0700

        fix feedback context

    commit b5b90b7
    Author: Tanner Linsley <tannerlinsley@gmail.com>
    Date:   Thu Jan 8 01:09:54 2026 -0700

        fix auto theme, add single showcase vieo

    commit 4ceba28
    Author: Tanner Linsley <tannerlinsley@gmail.com>
    Date:   Thu Jan 8 01:05:49 2026 -0700

        fix ai landing

    commit fd770cb
    Author: Tanner Linsley <tannerlinsley@gmail.com>
    Date:   Thu Jan 8 00:44:02 2026 -0700

        Add powersync to partners

commit 8f59a9239d47ce0e8720adad9a95f684aaa55568
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Thu Jan 8 00:23:51 2026 -0700

    checkpoint

* style: improve CodeBlock title extraction and enhance Tabs component handling

* style: add FileTabs component and enhance code block styling for file tabs

* style: enhance package manager tabs with improved code block styling

* style: add FrameworkCodeBlock component and enhance code block extraction for framework-specific tabs

* checkpoint

* checkpoint

* style: improve code structure and enhance rendering of tab panel children

* ci: apply automated fixes

---------

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 18, 2026

View your CI Pipeline Execution ↗ for commit 4944fa6

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-18 05:28:13 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants