-
-
Notifications
You must be signed in to change notification settings - Fork 522
Open
Description
Describe the bug
The onResult hook of useQuery is called in a (for me) confusing manner. Its behavior is not documented.
// call without any non-default fetch-policy
const { onResult } = useQuery(query, ...);
onResult((...agrs) => console.log(args))
// when no result in cache and call goes to server, onResult is called twice
// 1st with no data prop, loading === true and partial == true
// 2nd with data prop, loading === false, partial === undefined
// when result in cache, onResult is only called once
// with data prop, loading === false, partial === undefined
// call without any non-default fetch-policy
const { onResult } = useQuery(query, ..., { fetchPolicy: "no-cache"});
onResult((...agrs) => console.log(args))
// onResult is only called once
// with data prop, loading === false, partial === undefined
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Versions
vue: 3.5.16
vue-apollo: 4.2.2
@apollo/client:3.13.8
Metadata
Metadata
Assignees
Labels
No labels