I recently updated my Apollo Client version from 3.5.8 to 3.12.0, and now I’m encountering an error when using the useLazyQuery
hook. The error states:
observable.reobserveAsConcast is not a function
This error appears to be triggered within the executeQuery
function, which is used internally by useLazyQuery
. Here’s is the code: https://github.com/apollographql/apollo-client/blob/6ffb5a34a39657568db7f4e42ed60d8679cb817f/src/react/hooks/useLazyQuery.ts#L222
I’m using useLazyQuery
like this:
const [
fetchData,
{ data, loading: isLoading, error: fetchError },
] = useLazyQuery(SOME_QUERY, {
fetchPolicy: "no-cache",
});
The error occurs whenever I trigger the fetchData
function.
I also updated react
from version 17 to 18
Are there any changes in how useLazyQuery
or ObservableQuery
should be used in Apollo Client 3.12.0?
I would greatly appreciate any guidance or insights into resolving this issue. Thank you!