3.8.0-beta.0
Minor Changes
-
#10887
f8c0b965dThanks @phryneas! - Add a new mechanism for Error Extraction to reduce bundle size by including
error message texts on an opt-in basis.
By default, errors will link to an error page with the entire error message.
This replaces "development" and "production" errors and works without
additional bundler configuration.
Bundling the text of error messages and development warnings can be enabled byimport { loadErrorMessages, loadDevMessages } from "@apollo/client/dev"; if (process.env.NODE_ENV !== "production") { loadErrorMessages(); loadDevMessages(); }
-
#10509
79df2c7baThanks @jerelmiller! - Add the ability to specify custom GraphQL document transforms. These transforms are run before reading data from the cache, before local state is resolved, and before the query document is sent through the link chain.To register a custom document transform, create a transform using the
DocumentTransformclass and pass it to thedocumentTransformoption onApolloClient.import { DocumentTransform } from "@apollo/client"; const documentTransform = new DocumentTransform((document) => { // do something with `document` return transformedDocument; }); const client = new ApolloClient({ documentTransform: documentTransform });
For additional documentation on the behavior and API of
DocumentTransform, see the pull request. -
#10916
ea75e18deThanks @alessbell! - Remove experimental labels from hooks, move to beta.