text: import React from "react";
  import ReactDOM from "react-dom";
  import ApolloClient from "apollo-client";
  import { ApolloProvider } from "react-apollo";
  import { split } from 'apollo-link';
  import { HttpLink } from 'apollo-link-http';
  import { WebSocketLink } from 'apollo-link-ws';
  import { getMainDefinition } from 'apollo-utilities';
  import { InMemoryCache } from 'apollo-cache-inmemory'
  import App from "./App";
  
  import "./index.css";
  
  // Create an http link:
  const httpLink = new HttpLink({
    uri: 'http://192.168.0.152:4000'
  });
  
  // Create a WebSocket link:
  const wsLink = new WebSocketLink({
    uri: `ws://192.168.0.152:4000/`,
    options: {
      reconnect: true,
      lazy: true,
      inactivityTimeout: 30000,
    }
  });
  
  // using the ability to split links, you can send data to each link
  // depending on what kind of operation is being sent
  const link = split(
    // split based on operation type
    ({ query }) => {
      const { kind, operation } = getMainDefinition(query);
      return kind === 'OperationDefinition' && operation === 'subscription';
    },
    wsLink,
    httpLink,
  );
  
  const client = new ApolloClient({
    link,
    cache: new InMemoryCache()
  })
  
  ReactDOM.render(
    <ApolloProvider client={client}>
      <App />
    </ApolloProvider>,
    document.getElementById("root")
  );
  
  