Skip to content

Commit

Permalink
chore: update advanced example
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell committed Oct 24, 2022
1 parent 663c042 commit bda67a0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
28 changes: 19 additions & 9 deletions examples/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,31 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"apollo-cache-inmemory": "1.x",
"apollo-client": "2.x",
"@apollo/client": "3.7.1",
"apollo-link-rest": "0.x",
"graphql": "0.x",
"graphql-tag": "2.x",
"qs": "^6.6.0",
"react": "16.x",
"react-apollo": "2.x",
"react-dom": "16.x",
"react-scripts": "1.x"
"graphql": "16.6.0",
"graphql-tag": "2.12.6",
"qs": "6.11.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
4 changes: 1 addition & 3 deletions examples/advanced/src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { Component } from 'react';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloProvider } from 'react-apollo';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
import { RestLink } from 'apollo-link-rest';
import SearchShow from './SearchShow';
import './App.css';
Expand Down
6 changes: 4 additions & 2 deletions examples/advanced/src/SearchShow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { graphql } from 'react-apollo';
import { graphql } from '@apollo/client/react/hoc';
import gql from 'graphql-tag';

const Season = ({ summary, number, image }) => (
Expand Down Expand Up @@ -27,7 +27,9 @@ const Query = gql`

class ShowsResult extends Component {
render() {
const { data: { loading, error, show } } = this.props;
const {
data: { loading, error, show },
} = this.props;
if (loading) {
return <h4>Loading...</h4>;
}
Expand Down
6 changes: 4 additions & 2 deletions examples/advanced/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
const container = document.getElementById('root');
const root = createRoot(container);
root.render(<App />);

0 comments on commit bda67a0

Please sign in to comment.