apollo-link-http-common is an internal utility package within the deprecated `apollo-link` ecosystem, specifically designed to provide shared HTTP functionalities for other Apollo Link packages like `apollo-link-http` and `apollo-link-http-batch`. It extracts common logic for handling HTTP requests and responses, but it is not intended for direct consumption by end-user applications. The package, currently at version 0.2.16, explicitly warns that its API is unstable and versions may not adhere to SemVer, reflecting its role as a rapidly evolving internal component. Since Apollo Client 3.0, the entire `apollo-link` library, including this common utilities package, has been largely deprecated. Its core functionalities have been integrated directly into `@apollo/client/link/http`, making direct use of `apollo-link-http-common` obsolete and actively discouraged. Developers should migrate to the equivalent utilities provided by `@apollo/client` for stable HTTP networking.
npm install apollo-link-http-commonVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how an internal utility like `parseAndCheckHttpResponse` from `apollo-link-http-common` would process a mock HTTP response into a GraphQL result. It highlights the package's internal, lower-level role in handling network responses, not its direct use in creating an Apollo Link. This package is deprecated; for actual Apollo Client HTTP networking, use `@apollo/client/link/http`.
Migrate your application to use `@apollo/client/link/http` and other `@apollo/client` features directly. Remove all `apollo-link`, `apollo-link-http`, and `apollo-link-http-common` dependencies.
Avoid direct reliance on this package if possible. If you must use it (e.g., in a legacy `apollo-link` setup), pin exact versions and rigorously test updates. The recommended fix is to migrate to `@apollo/client`.
Recognize this package's internal role. For user-facing HTTP links, use the stable `HttpLink` from `@apollo/client` (since v3) or `apollo-link-http` (for older Apollo Client versions).
Remove the `apollo-link-http-common` dependency. The functionality is now integrated into `@apollo/client/link/http`. Adapt your code to use `@apollo/client`'s native HTTP link functionality.
Install `graphql` as a dependency: `npm install graphql` or `yarn add graphql`. Ensure its version is compatible with the peer dependency range specified.