From 9836ef6e1a5fb00d7120d7617e0a8e003aadff12 Mon Sep 17 00:00:00 2001 From: James Baxley Date: Sat, 13 Aug 2016 17:46:30 -0400 Subject: [PATCH] fix refetch bug --- Changelog.md | 4 ++++ package.json | 2 +- src/graphql.tsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 5523796c60..2a5b29862b 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. +### v4.0.2 + +- Bug: Fixed refetch methods when no result is returned + ### v4.0.1 - BREAKING Feature: [Brand new API! See the docs for more information](http://docs.apollostack.com/apollo-client/react.html); diff --git a/package.json b/package.json index 7b7a51deac..322c5551df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-apollo", - "version": "0.4.1", + "version": "0.4.2", "description": "React data container for Apollo Client", "main": "index.js", "scripts": { diff --git a/src/graphql.tsx b/src/graphql.tsx index 988787bd42..c9546a6dae 100644 --- a/src/graphql.tsx +++ b/src/graphql.tsx @@ -459,7 +459,7 @@ export default function graphql( // XXX why doesn't apollo-client fire next on a refetch with the same data? return refetchMethod(vars, ...args) .then((result) => { - if (isEqual(result.data, oldData)) next(result); + if (result && isEqual(result.data, oldData)) next(result); return result; }); };