useQuery fix

This commit is contained in:
Riccardo
2021-01-04 18:48:05 +01:00
parent 61acbf02d8
commit 82055b4040
11 changed files with 405 additions and 381 deletions

View File

@@ -5,7 +5,6 @@ import App from './components/App';
import { BrowserRouter } from 'react-router-dom';
// import * as serviceWorker from './serviceWorker';
// 1
import {
ApolloProvider,
ApolloClient,
@@ -13,18 +12,15 @@ import {
InMemoryCache
} from '@apollo/client';
// 2
const httpLink = createHttpLink({
uri: 'http://localhost:5000/graphql'
uri: 'http://localhost:4000/graphql'
});
// 3
const client = new ApolloClient({
link: httpLink,
cache: new InMemoryCache()
});
// 4
ReactDOM.render(
<BrowserRouter>
<ApolloProvider client={client}>
@@ -36,9 +32,6 @@ ReactDOM.render(
// serviceWorker.unregister();
// import React from 'react';
// import { BrowserRouter } from 'react-router-dom';
// import { setContext } from '@apollo/client/link/context';
// import { AUTH_TOKEN } from './constants';
@@ -55,25 +48,6 @@ ReactDOM.render(
// // export default App;
// // import React from 'react';
// import ReactDOM from 'react-dom';
// import './styles/index.css';
// import './styles/tachyons.min.css'
// import App from './components/App';
// // // import * as serviceWorker from './serviceWorker';
// // // 1
// import {
// ApolloProvider,
// ApolloClient,
// createHttpLink,
// InMemoryCache
// } from '@apollo/client';
// // 2
// const httpLink = createHttpLink({
// uri: 'http://localhost:4000'
// });
// // attach the auth_token to all requests to GraphQL server
// const authLink = setContext((_, { headers }) => {
@@ -114,17 +88,6 @@ ReactDOM.render(
// cache: new InMemoryCache()
// });
// // 4
// ReactDOM.render(
// <BrowserRouter>
// <ApolloProvider client={client}>
// <App />
// </ApolloProvider>
// </BrowserRouter>,
// document.getElementById('root')
// );
// // serviceWorker.unregister();
// // If you want to start measuring performance in your app, pass a function
// // to log results (for example: reportWebVitals(console.log))
// // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals