Skip to content

Commit fcb2222

Browse files
committed
Update CRA and packages
1 parent ff9eaf5 commit fcb2222

File tree

7 files changed

+14316
-15853
lines changed

7 files changed

+14316
-15853
lines changed

package-lock.json

Lines changed: 14238 additions & 15644 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 52 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,65 @@
11
{
22
"name": "guide",
3-
"version": "0.1.0",
3+
"version": "1.0.0",
44
"private": true,
55
"scripts": {
66
"start": "react-scripts start",
77
"build": "react-scripts build",
8-
"test": "react-scripts test --env=jsdom",
8+
"test": "react-scripts test",
99
"eject": "react-scripts eject",
10-
"now-start": "serve --single ./build",
11-
"deploy": "now",
12-
"alias": "pbpaste | xargs -I % now alias % staging.graphql.guide",
1310
"lint": "eslint src/",
14-
"update-schema": "graphql get-schema -e https://api.graphql.guide/graphql -o schema.json",
15-
"update-schema-spacex": "graphql get-schema -e https://api.spacex.land/graphql -o spacex.json",
16-
"update-schema-local": "graphql get-schema -e http://localhost:4000/graphql -o schema.json"
11+
"update-schema": "apollo schema:download --endpoint https://api.graphql.guide/graphql schema.json",
12+
"update-schema-spacex": "apollo schema:download --endpoint https://api.spacex.land/graphql spacex.json",
13+
"update-schema-local": "apollo schema:download --endpoint http://localhost:4000/graphql schema.json"
1714
},
1815
"dependencies": {
19-
"@material-ui/core": "^3.9.2",
20-
"@material-ui/icons": "^3.0.2",
21-
"ajv": "^6.10.0",
22-
"apollo-cache-inmemory": "^1.5.1",
23-
"apollo-cache-persist": "^0.1.1",
24-
"apollo-client": "^2.5.1",
25-
"apollo-link": "^1.2.11",
26-
"apollo-link-context": "^1.0.17",
27-
"apollo-link-error": "^1.1.10",
28-
"apollo-link-http": "^1.5.14",
29-
"apollo-link-rest": "^0.7.0",
30-
"apollo-link-state": "^0.4.2",
31-
"apollo-link-ws": "^1.0.17",
32-
"apollo-utilities": "^1.2.1",
33-
"auth0-helpers": "^0.4.3",
34-
"auth0-js": "^9.10.1",
35-
"classnames": "^2.2.6",
36-
"cloudinary-core": "^2.6.2",
37-
"cloudinary-react": "^1.1.0",
38-
"date-fns": "^1.30.1",
39-
"formik": "^1.5.1",
40-
"graphql": "^14.1.1",
41-
"graphql-anywhere": "^4.2.1",
42-
"graphql-tag": "^2.10.1",
16+
"@apollo/client": "3.1.3",
17+
"@material-ui/core": "3.9.3",
18+
"@material-ui/icons": "3.0.2",
19+
"@testing-library/jest-dom": "^4.2.4",
20+
"@testing-library/react": "^9.3.2",
21+
"@testing-library/user-event": "^7.1.2",
22+
"ajv": "6.12.3",
23+
"apollo": "^2.30.2",
24+
"apollo-cache-persist": "0.1.1",
25+
"apollo-link-rest": "0.8.0-beta.0",
26+
"auth0-helpers": "0.4.3",
27+
"auth0-js": "9.13.4",
28+
"classnames": "2.2.6",
29+
"cloudinary-core": "2.11.1",
30+
"cloudinary-react": "1.6.6",
31+
"date-fns": "^2.15.0",
32+
"eslint-plugin-graphql": "4.0.0",
33+
"graphql": "15.3.0",
34+
"graphql-anywhere": "4.2.7",
4335
"jss": "^9.8.7",
44-
"lodash": "^4.17.11",
45-
"react": "^16.8.5",
46-
"react-apollo": "^2.5.2",
47-
"react-dom": "^16.8.5",
48-
"react-loading-skeleton": "^1.1.1",
49-
"react-markdown": "^4.0.6",
50-
"react-odometerjs": "^2.1.1",
51-
"react-router": "^5.0.0",
52-
"react-router-dom": "^5.0.0",
53-
"react-scripts": "^2.1.8",
54-
"react-star-rating-component": "^1.4.1",
55-
"react-style-proptype": "^3.2.2",
56-
"react-transition-group": "^2.7.0",
57-
"recompose": "^0.30.0",
58-
"revalidate": "^1.2.0",
59-
"scroll-into-view-if-needed": "^2.2.20",
60-
"serve": "^10.1.2",
61-
"subscriptions-transport-ws": "^0.9.16",
62-
"typed.js": "^2.0.10",
63-
"typescript": "^3.3.4000"
36+
"lodash": "4.17.19",
37+
"react": "16.13.1",
38+
"react-dom": "16.13.1",
39+
"react-loading-skeleton": "2.1.1",
40+
"react-markdown": "4.3.1",
41+
"react-odometerjs": "2.1.1",
42+
"react-router": "5.2.0",
43+
"react-router-dom": "5.2.0",
44+
"react-scripts": "3.4.1",
45+
"react-star-rating-component": "1.4.1",
46+
"react-style-proptype": "3.2.2",
47+
"recompose": "0.30.0",
48+
"request": "^2.88.2",
49+
"revalidate": "1.2.0",
50+
"scroll-into-view-if-needed": "2.2.25",
51+
"subscriptions-transport-ws": "0.9.17"
6452
},
65-
"devDependencies": {
66-
"eslint-plugin-graphql": "^3.0.3",
67-
"graphql-cli": "^3.0.11"
68-
},
69-
"browserslist": [
70-
">0.2%",
71-
"not dead",
72-
"not ie <= 11",
73-
"not op_mini all"
74-
]
53+
"browserslist": {
54+
"production": [
55+
">0.2%",
56+
"not dead",
57+
"not op_mini all"
58+
],
59+
"development": [
60+
"last 1 chrome version",
61+
"last 1 firefox version",
62+
"last 1 safari version"
63+
]
64+
}
7565
}
File renamed without changes.

src/components/StarCount.js

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
import React from 'react'
2-
import PropTypes from 'prop-types'
3-
import { Query } from 'react-apollo'
4-
import gql from 'graphql-tag'
5-
6-
const StarCount = ({ githubStars, loading }) => {
7-
return (
8-
<a className="StarCount" href="https://github.com/GraphQLGuide/guide">
9-
{githubStars}
10-
</a>
11-
)
12-
}
13-
14-
StarCount.propTypes = {
15-
githubStars: PropTypes.number,
16-
loading: PropTypes.bool.isRequired
17-
}
2+
import { gql, useQuery } from '@apollo/client'
183

194
const STARS_QUERY = gql`
205
query StarsQuery {
216
githubStars
227
}
238
`
249

25-
export default () => (
26-
<Query query={STARS_QUERY}>
27-
{({ data: { githubStars }, loading }) => (
28-
<StarCount githubStars={githubStars} loading={loading} />
29-
)}
30-
</Query>
31-
)
10+
export default () => {
11+
const { data } = useQuery(STARS_QUERY)
12+
13+
return (
14+
<a
15+
className="StarCount"
16+
href="https://github.com/GraphQLGuide/guide"
17+
target="_blank"
18+
rel="noopener noreferrer"
19+
>
20+
{data && data.githubStars}
21+
</a>
22+
)
23+
}

src/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
import React from 'react'
2-
import ReactDOM from 'react-dom'
2+
import { render } from 'react-dom'
3+
import {
4+
ApolloClient,
5+
ApolloProvider,
6+
InMemoryCache,
7+
HttpLink,
8+
} from '@apollo/client'
9+
310
import './index.css'
411
import App from './components/App'
5-
import registerServiceWorker from './registerServiceWorker'
6-
import { ApolloClient } from 'apollo-client'
7-
import { ApolloProvider } from 'react-apollo'
8-
import { InMemoryCache } from 'apollo-cache-inmemory'
9-
import { createHttpLink } from 'apollo-link-http'
1012

11-
const link = createHttpLink({
12-
uri: 'https://api.graphql.guide/graphql'
13+
const link = new HttpLink({
14+
uri: 'https://api.graphql.guide/graphql',
1315
})
1416

1517
const cache = new InMemoryCache()
1618

1719
const client = new ApolloClient({ link, cache })
1820

19-
ReactDOM.render(
21+
render(
2022
<ApolloProvider client={client}>
2123
<App />
2224
</ApolloProvider>,
2325
document.getElementById('root')
2426
)
2527

26-
registerServiceWorker()
27-
2828
module.hot.accept()

src/jsconfig.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/registerServiceWorker.js

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)