<commit_before>import React from "react"
import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client"
import { setContext } from "@apollo/client/link/context"
import { CachePersistor, LocalStorageWrapper } from "apollo3-cache-persist"
import localForage from "localforage"
import { version as schema_version } from "dicty-graphql-schema/package.json"
import { mutationList } from "common/graphql/mutations"
import {
  listStrainsWithAnnotationPagination,
  listPlasmidsWithAnnotationPagination,
  listStrainsPagination,
  listPlasmidsPagination,
} from "common/graphql/pagination"

// SCHEMA_VERSION is tied directly to the latest version of the dicty-graphql-schema library.
const SCHEMA_VERSION = schema_version
const SCHEMA_VERSION_KEY = "dsc-apollo-schema-version"
const DSC_CACHE_KEY = "dsc-apollo-cache-persist"

const isMutation = (value: string) => {
  if (mutationList.includes(value)) {
    return true
  }
  return false
}

const getGraphQLServer = (url: string, deployEnv: string, origin: string) => {
  if (deployEnv === "staging" && origin === "https://dictycr.org") {
    return process.env.REACT_APP_ALT_GRAPHQL_SERVER
  }
  return url
}

const cache = new InMemoryCache({
  typePolicies: {
    Query: {
      fields: {
        listPlasmids: listPlasmidsPagination(),
        listStrains: listStrainsPagination(),
        listStrainsWithAnnotation: listStrainsWithAnnotationPagination(),
        listPlasmidsWithAnnotation: listPlasmidsWithAnnotationPagination(),
      },
    },<commit_msg>refactor: remove extra constant<commit_after>import React from "react"
import { ApolloClient, InMemoryCache, createHttpLink } from "@apollo/client"
import { setContext } from "@apollo/client/link/context"
import { CachePersistor, LocalStorageWrapper } from "apollo3-cache-persist"
import localForage from "localforage"
import { version as SCHEMA_VERSION } from "dicty-graphql-schema/package.json"
import { mutationList } from "common/graphql/mutations"
import {
  listStrainsWithAnnotationPagination,
  listPlasmidsWithAnnotationPagination,
  listStrainsPagination,
  listPlasmidsPagination,
} from "common/graphql/pagination"

const SCHEMA_VERSION_KEY = "dsc-apollo-schema-version"
const DSC_CACHE_KEY = "dsc-apollo-cache-persist"

const isMutation = (value: string) => {
  if (mutationList.includes(value)) {
    return true
  }
  return false
}

const getGraphQLServer = (url: string, deployEnv: string, origin: string) => {
  if (deployEnv === "staging" && origin === "https://dictycr.org") {
    return process.env.REACT_APP_ALT_GRAPHQL_SERVER
  }
  return url
}

const cache = new InMemoryCache({
  typePolicies: {
    Query: {
      fields: {
        listPlasmids: listPlasmidsPagination(),
        listStrains: listStrainsPagination(),
        listStrainsWithAnnotation: listStrainsWithAnnotationPagination(),
        listPlasmidsWithAnnotation: listPlasmidsWithAnnotationPagination(),
      },
    },
{'fraction_non_alphanumeric': 0.10061391541609822, 'fraction_numerical': 0.0006821282401091405, 'mean_word_length': 4.937246963562753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '3389171', 'n_tokens_mistral': 916, 'n_tokens_neox': 923, 'n_words': 194}