From 2590bc61796b604cd612b25f51521c334a79cc3d Mon Sep 17 00:00:00 2001 From: James Baxley Date: Mon, 5 Sep 2016 11:29:23 -0400 Subject: [PATCH] remove option of passing client as props and fix error message accordingly --- src/graphql.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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 = {};