Skip to content

Commit e5befbd

Browse files
Merge pull request #53 from detroitledger/jm-upgrade-apollo-client
Upgrade to Apollo Client 3.x
2 parents 9e438ae + 4f3f15d commit e5befbd

File tree

12 files changed

+112
-191
lines changed

12 files changed

+112
-191
lines changed

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@
1717
"author": "Benjamin Chodoroff",
1818
"license": "MIT",
1919
"dependencies": {
20-
"@apollo/react-components": "3.1.4",
21-
"@apollo/react-hooks": "3.1.4",
20+
"@apollo/client": "^3.3.12",
2221
"@bnchdrff/react-user-tour": "^3.0.1",
23-
"apollo-boost": "0.4.7",
24-
"apollo-client": "2.6.8",
2522
"axios": "^0.15.3",
2623
"cross-fetch": "^1.1.1",
2724
"eslint-plugin-react": "^7.14.3",
2825
"graphql": "14.5.5",
29-
"graphql-tag": "2.10.0",
3026
"graphql-tools": "^0.9.0",
3127
"http-proxy-middleware": "^0.20.0",
3228
"immutability-helper": "^2.0.0",

src/containers/AddGrant.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState } from 'react';
22

3-
import { gql } from 'apollo-boost';
4-
import { useMutation } from '@apollo/react-hooks';
3+
import { gql, useMutation } from '@apollo/client';
54
import DatePicker from 'react-datepicker';
65

76
import { Link } from 'react-router-dom';

src/containers/Grants.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React, { useState } from 'react';
22

33
import { Switch, Route, useRouteMatch, useParams } from 'react-router-dom';
44

5-
import { gql } from 'apollo-boost';
6-
import { useQuery } from '@apollo/react-hooks';
5+
import { useQuery, gql } from '@apollo/client';
76

87
import Helmet from 'react-helmet';
98

src/containers/OrgNteeTags.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React from 'react';
22

33
import { Switch, Route, useRouteMatch, useParams } from 'react-router-dom';
44

5-
import { gql } from 'apollo-boost';
6-
import { useQuery } from '@apollo/react-hooks';
5+
import { useQuery, gql } from '@apollo/client';
76

87
import Helmet from 'react-helmet';
98

src/containers/OrganizationSelector.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { useLazyQuery } from '@apollo/react-hooks';
2-
import { gql } from 'apollo-boost';
1+
import { useLazyQuery, gql } from '@apollo/client';
32
import PropTypes from 'prop-types';
43
import React from 'react';
54

src/containers/Organizations.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { Switch, Route, useRouteMatch, useParams } from 'react-router-dom';
55
import { uniq, map, filter, findIndex, sortBy } from 'lodash';
66
import moment from 'moment';
77

8-
import { gql } from 'apollo-boost';
9-
import { useQuery } from '@apollo/react-hooks';
8+
import { useQuery, gql } from '@apollo/client';
109

1110
import Helmet from 'react-helmet';
1211

src/containers/SearchResult.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22

3-
import { useQuery } from '@apollo/react-hooks';
4-
import gql from 'graphql-tag';
3+
import { useQuery, gql } from '@apollo/client';
54
import PropTypes from 'prop-types';
65
import { Link } from 'react-router-dom';
76

src/containers/Stats.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from 'react';
22
import numeral from 'numeral';
33

4-
import { useQuery } from '@apollo/react-hooks';
5-
import gql from 'graphql-tag';
4+
import { useQuery, gql } from '@apollo/client';
65

76
import { dollarsFormatter } from '../utils';
87

src/containers/TopLists.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from 'react';
22
import _ from 'lodash';
33

4-
import { useQuery } from '@apollo/react-hooks';
5-
import gql from 'graphql-tag';
4+
import { useQuery, gql } from '@apollo/client';
65

76
import { Col, Row } from 'react-bootstrap';
87

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
55

66
import { Provider } from 'react-redux';
77

8-
import { ApolloProvider } from '@apollo/react-hooks';
8+
import { ApolloProvider } from '@apollo/client';
99

1010
import configureStore from './store/configureStore';
1111

src/network/create-apollo-client.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import ApolloClient from 'apollo-boost';
1+
import { ApolloClient, InMemoryCache } from '@apollo/client';
2+
23
import store from 'store/dist/store.modern';
34

45
export default (apiUrl) => {
56
return new ApolloClient({
67
uri: apiUrl,
8+
cache: new InMemoryCache(),
79
request: (op) =>
810
op.setContext({
911
headers: {

0 commit comments

Comments
 (0)