text: import React from 'react';
  import { render } from 'react-dom';
  import { ApolloProvider } from '@apollo/client';
  import { ThemeProvider } from 'styled-components';
  import { createApolloClient } from 'utils/apollo-client';
  import { StoreProvider } from 'store';
  
  import 'normalize.css';
  import theme from 'theme';
  
  import App from 'components/App/App';
  
  // GraphQL HTTP URL
  const API_URL = process.env.REACT_APP_API_URL;
  
  // GraphQL WebSocket (subscriptions) URL.
  // If its url is not set in .env then it has same url, host and pathname
  const WEBSOCKET_API_URL = process.env.REACT_APP_WEBSOCKET_API_URL;
  const websocketApiUrl = WEBSOCKET_API_URL
    ? WEBSOCKET_API_URL
    : API_URL.replace('https://', 'ws://').replace('http://', 'ws://');
  
  // Create a Apollo client
  const apolloClient = createApolloClient(API_URL, websocketApiUrl);
  
  render(
    <ApolloProvider client={apolloClient}>
      <ThemeProvider theme={theme}>
        <StoreProvider>
          <App />
        </StoreProvider>
      </ThemeProvider>
    </ApolloProvider>,
    document.getElementById('root'),
  );
  