-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix(package/gqty): useTransactionQuery should work without suspense #2188
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
base: main
Are you sure you want to change the base?
Conversation
a1939cd
to
8ebcff1
Compare
8ebcff1
to
1da6588
Compare
@cdomigan Please feel free to test this canary, I'll release the patch once you find it working! |
Not sure if I'm using it wrong, but I'm getting partial results returned, eg adding the following test to it('should not return partially undefined results', async () => {
const { useTransactionQuery } = await createReactTestClient();
const { result } = renderHook(() =>
useTransactionQuery((query) => {
const human = query.human();
return {
name: human.name
};
}, { suspense: false })
);
expect(result.current.data).toBeUndefined();
await waitFor(() => expect(result.current.data).not.toBeUndefined());
expect(result.current.data?.name).toBeInstanceOf(String);
}); I'm seeing
The docs say that the data returned is |
@cdomigan You may have to wait until |
@vicary Thanks for that. DX a bit challenging with this, but I do understand this hook is considered legacy :) PR looks good in terms of fixing the linked issue, thank you! |
@cdomigan Despite marked as legacy, the purpose of this hook is to create a familiar experience for users from other libraries such as Apollo's Do you think |
Fixes #2187
Screen.Recording.2025-03-04.at.16.58.33.mov