Join us for GraphQL Summit, October 10-12 in San Diego. Use promo code ODYSSEY for $400 off your pass.
Docs
Launch GraphOS Studio

Error code details

For Apollo Client


Error message

Loading

File

Loading

Condition

What is this page?

Beginning with version 3.8, Apollo Client omits error messages from its core bundle to reduce its bundle size. Instead, errors direct you to this page to view details.

If you prefer, you can add Apollo Client error messages to your app:

App.js
import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev";
if (__DEV__) { // Adds messages only in a dev environment
loadDevMessages();
loadErrorMessages();
}
  • loadDevMessages() loads messages for errors that are raised only in a development environment.
  • loadErrorMessages() loads messages for errors that are raised in all environments.

You can call either or both of these methods on application load.

Note: The example above checks for the presence of the __DEV__ and loads error messages only if it's present (indicating a dev environment). This can provide a helpful development experience while minimizing your bundle size in production.

The __DEV__ isn't available in all environments. As an alternative, you can check whether process.env.NODE_ENV !== "production".

Next
Introduction
Edit on GitHubEditForumsDiscord