Skip to content

Commit

Permalink
fix: clean up properly after a graphql error (#501)
Browse files Browse the repository at this point in the history
replace react-apollo with npmjs.com/package/react-apollo-temp which is
a fork that provides a workaround to this issue
apollographql/apollo-client#2513
  • Loading branch information
BernieSumption authored and craigbilner committed Jan 5, 2018
1 parent 56487e7 commit fbd30f0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/provider/connect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import pick from "lodash.pick";
import { graphql } from "react-apollo";
import { graphql } from "react-apollo-temp";

const identity = a => a;

Expand Down Expand Up @@ -30,6 +30,7 @@ const connectGraphql = (query, propsToVariables = identity) => {
}

refetch() {
this.state.data.retry(); // FIXME: remove this after react-apollo fixes https://github.com/apollographql/apollo-client/issues/2513
this.state.data.refetch().then(response => {
this.setState(prevState => ({
...prevState,
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"lodash.get": "4.4.2",
"lodash.pick": "4.4.0",
"prop-types": "15.6.0",
"react-apollo": "2.0.1"
"react-apollo-temp": "2.0.5"
},
"peerDependencies": {
"react": ">=16",
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import React, { Component } from "react";
import ApolloClient from "apollo-client";
import { ApolloProvider } from "react-apollo";
import { MockLink } from "react-apollo/test-links";
import { ApolloProvider } from "react-apollo-temp";
import { MockLink } from "react-apollo-temp/lib/test-links";
import {
InMemoryCache as Cache,
IntrospectionFragmentMatcher
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
"graphql": "0.11.7",
"prop-types": "15.6.0",
"react": "16.2.0",
"react-apollo": "2.0.1"
"react-apollo-temp": "2.0.5"
}
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8430,9 +8430,9 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-apollo@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/react-apollo/-/react-apollo-2.0.1.tgz#43997db9f294d81bd229eb705944fb36d5164607"
react-apollo-temp@2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/react-apollo-temp/-/react-apollo-temp-2.0.5.tgz#3a44901a252c7721b600fe63f906492a12f90229"
dependencies:
apollo-link "^1.0.0"
hoist-non-react-statics "^2.2.0"
Expand Down

0 comments on commit fbd30f0

Please sign in to comment.