-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
useLazyQuery throws typescript error #12324
Comments
Could you please verify that you don't have two versions of Apollo Client installed side-by-side by chance? If you use |
When i tried, I use internal shared package which has this package as dependency. |
It's more about the version numbers - to me this looks like you have a mix of Apollo Client 3.12 and an older version going on - your |
yes, i tried with both created by my shared package as well direct Apollo client package. When I remove direct one, the hooks are getting triggered from my shared package and when I use direct one, its triggered from direct Apollo client hooks. Both time I am getting this typescript error. In my shared package, it was mentioned that @apollo/client : ^3.10.8 as dependency and when I did yarn install, it installed @apollo/client version "3.12.8" |
Not really relevant, but I want to point this out - a Back on topic: Could you please share the full output of
Also, just to make sure: did you clean all your caches, maybe nuke your |
Thanks @phryneas for the reply, let me delete node_modules and try it out once. Meanwhile, this the o/p I got when I ran why @apollo/client 1/4] 🤔 Why do we have the module "@apollo/client"...?
|
Issue Description
Hi Team,
I am using apollo/client v3.12.7 in my application. I am getting typescript error of "Uncaught TypeError: observable.maskResult is not a function" when I lazily loaded the components using useLazyQuery. When I checked the code, it goes to complete method of executeQuery function.
Link to Reproduction
//test
code:
import { useLazyQuery } from '@apollo/client';
import { GET_PROFILE } from '../get-profile';
export const Test = () => {
const [loadGreeting, { data, loading, called }] = useLazyQuery(GET_PROFILE,{});
if (called && loading) return {console.log('loading')};
if (!called) {
return {console.log('loading button')};
}
return
Hello I am in
;};
Reproduction Steps
No response
@apollo/client
version3.12.7 onwards
The text was updated successfully, but these errors were encountered: