<commit_before>import { ApolloClient, InMemoryCache, ApolloLink } from '@apollo/client';
import { BatchHttpLink } from '@apollo/client/link/batch-http';
import { apolloCacheVoteablePossibleTypes } from '../../../lib/make_voteable';
import meteorAccountsLink from './links/meteor';
import errorLink from './links/error';

export const createApolloClient = () => {
  const cache = new InMemoryCache({
    possibleTypes: {
      ...apolloCacheVoteablePossibleTypes()
    }
  })
    .restore((window as any).__APOLLO_STATE__); //ssr
  
  const httpLink = new BatchHttpLink({
    uri: '/graphql',
    credentials: 'same-origin',
  });
  
  return new ApolloClient({
    link: ApolloLink.from([errorLink, meteorAccountsLink, httpLink]),
    cache
  });
};<commit_msg>Increase the maximum queries per batch in BatchHttpLink from 10 to 50<commit_after>import { ApolloClient, InMemoryCache, ApolloLink } from '@apollo/client';
import { BatchHttpLink } from '@apollo/client/link/batch-http';
import { apolloCacheVoteablePossibleTypes } from '../../../lib/make_voteable';
import meteorAccountsLink from './links/meteor';
import errorLink from './links/error';

export const createApolloClient = () => {
  const cache = new InMemoryCache({
    possibleTypes: {
      ...apolloCacheVoteablePossibleTypes()
    }
  })
    .restore((window as any).__APOLLO_STATE__); //ssr
  
  const httpLink = new BatchHttpLink({
    uri: '/graphql',
    credentials: 'same-origin',
    batchMax: 50,
  });
  
  return new ApolloClient({
    link: ApolloLink.from([errorLink, meteorAccountsLink, httpLink]),
    cache
  });
};
{'fraction_non_alphanumeric': 0.13784461152882205, 'fraction_numerical': 0.0037593984962406013, 'mean_word_length': 3.959627329192547, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6743851', 'n_tokens_mistral': 526, 'n_tokens_neox': 492, 'n_words': 115}