diff --git a/Changelog.md b/Changelog.md index e51fd69421..7f9238b143 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ Expect active development and potentially significant breaking changes in the `0.x` track. We'll try to be diligent about releasing a `1.0` version in a timely fashion (ideally within 1 or 2 months), so that we can take advantage of SemVer to signify breaking changes from that point on. +### v0.3.15 + +Bug: Fixed issue where react native would error on aggressive cloneing of client + ### v0.3.14 Feature: pass through all methods on apollo client diff --git a/package.json b/package.json index 98d57eba89..6485ec711d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-apollo", - "version": "0.3.14", + "version": "0.3.15", "description": "React data container for Apollo Client", "main": "index.js", "scripts": { diff --git a/src/connect.tsx b/src/connect.tsx index e49c6363fa..83f7ded679 100644 --- a/src/connect.tsx +++ b/src/connect.tsx @@ -530,7 +530,19 @@ export default function connect(opts?: ConnectOptions) { clientProps.mutations = mutations; } - const mergedPropsAndData = assign({}, props, clientProps, this.client, data); + const mergedPropsAndData = assign({}, props, clientProps, data); + + // dynmically get all of the methods from ApolloClient + for (let key in this.client) { + if (!this.client.hasOwnProperty(key)) { + continue; + } + // don't overwrite any spyed methods like refetch + if (typeof this.client[key] === 'function' && !mergedPropsAndData[key]) { + mergedPropsAndData[key] = this.client[key]; + } + } + if ( !haveOwnPropsChanged && !hasOwnStateChanged &&