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

Commit

Permalink
pass all arguments through to child (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Baxley authored Jul 6, 2016
1 parent 0ae7c70 commit b597880
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.14

Feature: pass through all methods on apollo client

### v0.3.13

Bug: fixed issue causing errors to be passed to apollo-client [#89](https://github.com/apollostack/react-apollo/pull/89)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-apollo",
"version": "0.3.13",
"version": "0.3.14",
"description": "React data container for Apollo Client",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 2 additions & 6 deletions src/connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,17 +524,13 @@ export default function connect(opts?: ConnectOptions) {
this.hasQueryDataChanged = false;
this.hasMutationDataChanged = false;

let clientProps = {
mutate: this.client.mutate,
query: this.client.query,
watchQuery: this.client.watchQuery,
} as any;
let clientProps = {} as any;

if (Object.keys(mutations).length) {
clientProps.mutations = mutations;
}

const mergedPropsAndData = assign({}, props, data, clientProps);
const mergedPropsAndData = assign({}, props, clientProps, this.client, data);
if (
!haveOwnPropsChanged &&
!hasOwnStateChanged &&
Expand Down
1 change: 0 additions & 1 deletion test/client/connect/props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ describe('props', () => {


const props = wrapper.find('span').props() as any;

expect(props.query).to.exist;
expect(props.query({ query })).to.be.instanceof(Promise);

Expand Down
11 changes: 5 additions & 6 deletions test/client/connect/queries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,11 @@ describe('queries', () => {
};

const variables1 = {
person: 1
person: 1,
}

const variables2 = {
person: 2
person: 2,
}

const networkInterface = mockNetworkInterface(
Expand All @@ -557,7 +557,6 @@ describe('queries', () => {
networkInterface,
});

let firstRun = true;
function mapQueriesToProps({ state }) {
return {
people: {
Expand All @@ -574,7 +573,7 @@ describe('queries', () => {
case 'INCREMENT':
return state + 1
default:
return state
return state;
}
}

Expand Down Expand Up @@ -1926,9 +1925,9 @@ describe('queries', () => {
);

setTimeout(() => {
expect(localcount).to.equal(2);
expect(localcount).to.equal(1);
done();
}, 50);
}, 100);
});
it('should not swallow errors', (done) => {
const query = gql`
Expand Down
6 changes: 1 addition & 5 deletions test/client/connect/redux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ describe('redux integration', () => {
</ProviderMock>
);

const reduxProps = assign({}, wrapper.find('span').props(), {
query: undefined,
mutate: undefined,
watchQuery: undefined,
});
const reduxProps = assign({}, wrapper.find('span').props());
const apolloProps = apolloWrapper.find('span').props();

expect(reduxProps).to.deep.equal(apolloProps);
Expand Down

0 comments on commit b597880

Please sign in to comment.