Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
remove option of passing client as props and fix error message accord…
Browse files Browse the repository at this point in the history
…ingly (#189)
  • Loading branch information
James Baxley authored Sep 5, 2016
1 parent bd9d948 commit 626dbb7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ApolloProvider>, ` +
`or explicitly pass "client" as a prop to "${withDisplayName}".`
);
`Could not find "client" in the context of ` +
`"${withDisplayName}". ` +
`Wrap the root component in an <ApolloProvider>`
);

}


Expand Down Expand Up @@ -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 <ApolloProvider>, ` +
`or explicitly pass "client" as a prop to "${graphQLDisplayName}".`
`Could not find "client" in the context of ` +
`"${graphQLDisplayName}". ` +
`Wrap the root component in an <ApolloProvider>`
);

this.store = this.client.store;

this.type = operation.type;
this.queryObservable = {};
this.querySubscription = {};
Expand Down

0 comments on commit 626dbb7

Please sign in to comment.