Skip to content
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

fix(types): add pageParam and direction as optional to "normal" queryFn #7212

Merged
merged 5 commits into from
Apr 2, 2024

Conversation

TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Apr 2, 2024

because that's what we get when using a defaultQueryFn

closes #6715

because that's what we get when using a defaultQueryFn
Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Apr 2, 2024 11:45am

Copy link

nx-cloud bot commented Apr 2, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d227630. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@TkDodo
Copy link
Collaborator Author

TkDodo commented Apr 2, 2024

@DamianOsipiuk do you know why this small type change leads to this error?

src/createPersister.ts(81,17): error TS2742: The inferred type of 'experimental_createPersister' cannot be named without a reference to '../node_modules/@tanstack/query-core/build/modern/queryClient-lGFVn5Ps'. This is likely not portable. A type annotation is necessary.

Copy link

codesandbox-ci bot commented Apr 2, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d227630:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@TkDodo TkDodo merged commit e5bfbbe into main Apr 2, 2024
6 checks passed
@TkDodo TkDodo deleted the feature/defaultQueryFnTypes branch April 2, 2024 12:21
@DamianOsipiuk
Copy link
Contributor

DamianOsipiuk commented Apr 2, 2024

@DamianOsipiuk do you know why this small type change leads to this error?

src/createPersister.ts(81,17): error TS2742: The inferred type of 'experimental_createPersister' cannot be named without a reference to '../node_modules/@tanstack/query-core/build/modern/queryClient-lGFVn5Ps'. This is likely not portable. A type annotation is necessary.

This is potentially due to how tsup is bundling types.
I remember that @Andarist potentially fixed that in TS 5.4.
#6318 (comment)

Potential workaround is to import module from which problematic type is referenced.

More long term fix would be to fix it in tsup or migrate to rollup.

Or depend on users upgrading their TS version 😞

@Andarist
Copy link
Contributor

Andarist commented Apr 4, 2024

I remember that @Andarist potentially fixed that in TS 5.4.

that fix has been reverted though (see microsoft/TypeScript#57849 )

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

Successfully merging this pull request may close these issues.

pageParam missing from default queryFn typescript definition
3 participants