Backup before moving state to app.js
This commit is contained in:
5
client/src/graphql/initial-state.js
Normal file
5
client/src/graphql/initial-state.js
Normal file
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
currentSelectedNavItem: null,
|
||||
currentUser: null,
|
||||
token: null
|
||||
};
|
||||
@@ -7,6 +7,7 @@ import { createHttpLink } from "apollo-link-http";
|
||||
import { InMemoryCache } from "apollo-cache-inmemory";
|
||||
import { ApolloClient } from "apollo-boost";
|
||||
import { typeDefs, resolvers } from "./graphql/resolvers";
|
||||
import initialState from "./graphql/initial-state";
|
||||
// require('dotenv').config()
|
||||
|
||||
import * as serviceWorker from "./serviceWorker";
|
||||
@@ -14,26 +15,23 @@ import * as serviceWorker from "./serviceWorker";
|
||||
import "./index.css";
|
||||
import { default as App } from "./App/App.container";
|
||||
|
||||
const token = client.readQuery
|
||||
|
||||
const httpLink = createHttpLink({
|
||||
uri: "https://bodyshop-dev-db.herokuapp.com/v1/graphql"
|
||||
});
|
||||
|
||||
const cache = new InMemoryCache();
|
||||
|
||||
|
||||
const client = new ApolloClient({
|
||||
link: httpLink,
|
||||
cache,
|
||||
cache: new InMemoryCache(),
|
||||
typeDefs,
|
||||
resolvers
|
||||
});
|
||||
|
||||
client.writeData({
|
||||
data: {
|
||||
currentSelectedNavItem: null,
|
||||
currentUser: null,
|
||||
authState: null,
|
||||
gqlToken: null
|
||||
}
|
||||
data: initialState
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
|
||||
Reference in New Issue
Block a user