Skip to content

Instantly share code, notes, and snippets.

Last active Apr 16, 2019
What would you like to do?
Apollo-blog root App component
import React, { Component } from 'react'
import ApolloClient from 'apollo-boost'
import { ApolloProvider } from 'react-apollo'
import { BrowserRouter, Route } from 'react-router-dom'
import './App.css'
import 'semantic-ui-css/semantic.min.css'
import Home from './views/home'
import Article from './views/article'
// creates our Graphql client using the CosmicJS Graphql endpoint
const client = new ApolloClient({
uri: ""
class App extends Component {
render() {
return (
<ApolloProvider client={client}>
<div className="router-container">
<Route exact path="/" component={Home} />
<Route path="/article/:articleName" component={Article} />
export default App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment