Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: clean up properly after a graphql error #501

Merged
merged 1 commit into from
Jan 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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