1
0
Fork 0
forked from OpenNeo/impress

Move Apollo error message stuff to apolloClient.js

This commit is contained in:
Emi Matchu 2023-08-10 18:59:47 -07:00
parent eef8f1349d
commit 2eb8a7cd60
2 changed files with 7 additions and 7 deletions

View file

@ -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(
<AppProvider>

View file

@ -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!