Skip to content

Conversation

@HassanBahati
Copy link
Member

@HassanBahati HassanBahati commented Nov 25, 2024

This PR adds useConnectQuery and useConnectMutation

@docs-page
Copy link

docs-page bot commented Nov 25, 2024

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/tanstack-query-firebase~129

Documentation is deployed and generated using docs.page.

@HassanBahati HassanBahati marked this pull request as ready for review November 26, 2024 06:39
@HassanBahati HassanBahati requested a review from Ehesp November 26, 2024 06:39
@HassanBahati HassanBahati changed the title feat: add useConnectQuery feat: add useConnectQuery and useConnectMutation Nov 27, 2024
Data = ReturnType<Fn> extends MutationRef<infer D, any> ? D : never,
Variables = Fn extends (
dc: DataConnect,
vars: infer V
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowing for DataConnect class instance and or just variables where the ref function can infer the variables directly given that the refs accommodate for this. for example this is a snapshot from the generated sdk for movies connector

image

TError = FirebaseError,
Variables = unknown
> = Omit<UseMutationOptions<TData, TError, Variables>, "mutationFn"> & {
invalidate?: QueryRef<unknown, unknown>[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll bring this one up, but I'm thinking we should try to support both a QueryRef & the inferred function function where we can just take the name.

@Ehesp Ehesp merged commit e269caa into invertase:next Dec 16, 2024
2 checks passed
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.

2 participants