diff --git a/app/javascript/wardrobe-2020-page.js b/app/javascript/wardrobe-2020-page.js index 7f428d79..361175ea 100644 --- a/app/javascript/wardrobe-2020-page.js +++ b/app/javascript/wardrobe-2020-page.js @@ -1,15 +1,8 @@ import React from "react"; import ReactDOM from "react-dom"; -import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev"; import { AppProvider, WardrobePage } from "./wardrobe-2020"; -// Use Apollo's error messages in development. -if (process.env["NODE_ENV"] === "development") { - loadErrorMessages(); - loadDevMessages(); -} - const rootNode = document.querySelector("#wardrobe-2020-root"); ReactDOM.render( diff --git a/app/javascript/wardrobe-2020/apolloClient.js b/app/javascript/wardrobe-2020/apolloClient.js index ca3a2f0c..b318801a 100644 --- a/app/javascript/wardrobe-2020/apolloClient.js +++ b/app/javascript/wardrobe-2020/apolloClient.js @@ -1,9 +1,16 @@ import { ApolloClient, createHttpLink, InMemoryCache } from "@apollo/client"; +import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev"; import { setContext } from "@apollo/client/link/context"; import { createPersistedQueryLink } from "apollo-link-persisted-queries"; import { getAuthModeFeatureFlag } from "./components/useCurrentUser"; +// Use Apollo's error messages in development. +if (process.env["NODE_ENV"] === "development") { + loadErrorMessages(); + loadDevMessages(); +} + // Teach Apollo to load certain fields from the cache, to avoid extra network // requests. This happens a lot - e.g. reusing data from item search on the // outfit immediately!