diff --git a/src/graphql.tsx b/src/graphql.tsx index 4d02eea39a..63632dff3d 100644 --- a/src/graphql.tsx +++ b/src/graphql.tsx @@ -105,14 +105,14 @@ export function withApollo(WrappedComponent) { constructor(props, context) { super(props, context); - this.client = props.client || context.client; + this.client = context.client; invariant(!!this.client, - `Could not find "client" in either the context or ` + - `props of "${withDisplayName}". ` + - `Either wrap the root component in an , ` + - `or explicitly pass "client" as a prop to "${withDisplayName}".` - ); + `Could not find "client" in the context of ` + + `"${withDisplayName}". ` + + `Wrap the root component in an ` + ); + } @@ -258,16 +258,16 @@ export default function graphql( constructor(props, context) { super(props, context); this.version = version; - this.client = props.client || context.client; - this.store = this.client.store; + this.client = context.client; invariant(!!this.client, - `Could not find "client" in either the context or ` + - `props of "${graphQLDisplayName}". ` + - `Either wrap the root component in an , ` + - `or explicitly pass "client" as a prop to "${graphQLDisplayName}".` + `Could not find "client" in the context of ` + + `"${graphQLDisplayName}". ` + + `Wrap the root component in an ` ); + this.store = this.client.store; + this.type = operation.type; this.queryObservable = {}; this.querySubscription = {};