Skip to content

Commit

Permalink
fix: Typescript error with strictNullChecks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Rasmus Eneman committed Jan 17, 2017
1 parent 389d87a commit f6d1d0e
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,7 @@ export default class ApolloClient {
* with identical parameters (query, variables, operationName) is already in flight.
*
*/
constructor({
networkInterface,
reduxRootKey,
reduxRootSelector,
initialState,
dataIdFromObject,
resultComparator,
ssrMode = false,
ssrForceFetchDelay = 0,
mutationBehaviorReducers = {} as MutationBehaviorReducerMap,
addTypename = true,
resultTransformer,
customResolvers,
connectToDevTools,
queryDeduplication = false,
}: {
constructor(options: {
networkInterface?: NetworkInterface,
reduxRootKey?: string,
reduxRootSelector?: string | ApolloStateSelector,
Expand All @@ -163,6 +148,22 @@ export default class ApolloClient {
connectToDevTools?: boolean,
queryDeduplication?: boolean,
} = {}) {
let {
networkInterface,
reduxRootKey,
reduxRootSelector,
initialState,
dataIdFromObject,
resultComparator,
ssrMode = false,
ssrForceFetchDelay = 0,
mutationBehaviorReducers = {} as MutationBehaviorReducerMap,
addTypename = true,
resultTransformer,
customResolvers,
connectToDevTools,
queryDeduplication = false,
} = options;
if (reduxRootKey && reduxRootSelector) {
throw new Error('Both "reduxRootKey" and "reduxRootSelector" are configured, but only one of two is allowed.');
}
Expand Down

0 comments on commit f6d1d0e

Please sign in to comment.