Add this to wherever the /assets
are located (looks like cloudfront):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ApolloConsumer, Query } from 'react-apollo'; | |
import gql from 'graphql-tag'; | |
const GET_MESSAGE_COUNT = gql` | |
{ | |
messageCount @client { | |
total | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Loadable from 'react-loadable'; | |
import Loading from './components/Loading'; | |
export const Stats = Loadable({ | |
loader: () => import('./components/stats/Stats'), | |
loading: Loading, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ApolloConsumer, Query } from 'react-apollo'; | |
import gql from 'graphql-tag'; | |
const GET_MESSAGE_COUNT = gql` | |
{ | |
messageCount @client { | |
total | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Route } from 'react-router-dom'; | |
import Header from '../components/Header'; | |
import { Home, Messages, Stats } from '../lazy' | |
const App = () => ( | |
<div className="app"> | |
<Header /> | |
<Route exact path="/" component={Home} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render } from 'react-dom'; | |
import { BrowserRouter as Router } from 'react-router-dom'; | |
import { ApolloClient } from 'apollo-client'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { ApolloProvider } from 'react-apollo'; | |
import App from './components/App'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient } from 'apollo-client'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import gql from 'graphql-tag'; | |
const client = new ApolloClient({ | |
cache: new InMemoryCache(), | |
resolvers: { | |
User: { | |
isLoggedIn() { | |
return !!localStorage.getItem('token'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient } from 'apollo-client'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import { HttpLink } from 'apollo-link-http'; | |
import gql from 'graphql-tag'; | |
const query = gql` | |
query currentAuthorPosts($authorId: Int!) { | |
currentAuthorId @client @export(as: "authorId") | |
posts(authorId: $authorId) { | |
title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient } from 'apollo-client'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import { HttpLink } from 'apollo-link-http'; | |
import gql from 'graphql-tag'; | |
const GET_CART_ITEMS = gql` | |
query GetCartItems { | |
cartItems @client | |
} | |
`; |
NewerOlder