From 73f9b545e2629c7bd5d209f60ac5f5ab977018f3 Mon Sep 17 00:00:00 2001 From: "mirlan.maksitaliev" Date: Mon, 1 Jun 2020 20:39:32 +0600 Subject: [PATCH] feat: apollo client config --- src/config/routes.tsx | 1 + src/index.tsx | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/config/routes.tsx b/src/config/routes.tsx index ff4452e0..2f03b423 100644 --- a/src/config/routes.tsx +++ b/src/config/routes.tsx @@ -1 +1,2 @@ export const API_ROOT = '' +export const GRAPHQL = `${API_ROOT}/graphql` diff --git a/src/index.tsx b/src/index.tsx index 98389c5f..93c34645 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,15 +1,24 @@ import React from 'react' import ReactDOM from 'react-dom' +import ApolloClient from 'apollo-boost' +import { ApolloProvider } from '@apollo/react-hooks' +import { GRAPHQL } from 'config' import { App } from 'features/App' import * as serviceWorker from './serviceWorker' +const client = new ApolloClient({ + uri: GRAPHQL, +}) + ReactDOM.render( - + + + , - document.getElementById('root') + document.getElementById('root'), ) // If you want your app to work offline and load faster, you can change