-
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
Property undefined error in type definitions. #800
Comments
Looking at the definition:
The types aren't really compatible. We have a |
Which version of typescript are you using? I haven't seen this error before. |
@helfer I think it results from "strickNullChecks". If it is not turned on, whether "?" exists does not matter. It seems turned off (by default) in this repo. |
I can confirm this. My workaround was using
instead of
which skips the TypeScript definitions so I can keep |
I fixed this by manually editing the constructor();
constructor({networkInterface, reduxRootKey, reduxRootSelector, initialState, dataIdFromObject, resultComparator, ssrMode, ssrForceFetchDelay, mutationBehaviorReducers, addTypename, resultTransformer, customResolvers, connectToDevTools, queryDeduplication}: {
networkInterface?: NetworkInterface;
reduxRootKey?: string;
reduxRootSelector?: string | ApolloStateSelector;
initialState?: any;
dataIdFromObject?: IdGetter;
resultTransformer?: ResultTransformer;
resultComparator?: ResultComparator;
ssrMode?: boolean;
ssrForceFetchDelay?: number;
mutationBehaviorReducers?: MutationBehaviorReducerMap;
addTypename?: boolean;
customResolvers?: CustomResolverMap;
connectToDevTools?: boolean;
queryDeduplication?: boolean;
}); I was going to submit a PR for this, but the |
This is also biting me, also using |
fixes apollographql#800 Enabling strictNullChecks in apollo-client itself caused a lot of errors so while it may be best solution over time, this is a quicker one that fixes the current errors.
fixes apollographql#800 Enabling strictNullChecks in apollo-client itself caused a lot of errors so while it may be best solution over time, this is a quicker one that fixes the current errors.
Steps to Reproduce
Just import
apollo-client
.Buggy Behavior
Expected Behavior
No error.
Version
The text was updated successfully, but these errors were encountered: