Apollo Angular HTTP Link Common Logic (Internal)
This package, `apollo-angular-link-http-common` at version 1.10.0, provides shared, internal logic specifically for HTTP links within the broader `apollo-angular` ecosystem. It is explicitly marked as "for internal use only" in its README and documentation, advising developers "DO NOT USE DIRECTLY" in their applications. As such, it does not offer a public API intended for direct consumption. Its primary role is to encapsulate common functionalities leveraged by other `apollo-angular` link implementations, ensuring consistency and reducing code duplication across the library. The `apollo-angular` library, which this package supports, generally follows Angular's major release cycle, implying that this internal package's stability and compatibility are tied to `apollo-angular`'s roadmap and its underlying `@apollo/client` dependencies. It ships with TypeScript types to facilitate its internal integration within the `apollo-angular` monorepo.
Common errors
-
Module '[...]/apollo-angular-link-http-common' has no exported member 'X'.
cause Attempting to import a specific symbol 'X' directly from this internal package, which may not export it publicly or might have removed it in a minor update.fixThis package is not meant for direct consumption. Refactor your code to use the public APIs provided by `apollo-angular` or `@apollo/client` for GraphQL operations and HTTP link setup. Do not import directly from `apollo-angular-link-http-common`. -
Peer dependency 'graphql@...' must be installed.
cause Your project's `graphql` version does not fall within the specific peer dependency range required by `apollo-angular-link-http-common`.fixUpdate your project's `graphql` dependency to satisfy the range `>=0.11.0 <0.14.0 || ^14.0.0 || ^15.0.0`. Run `npm install` or `yarn install` after modifying `package.json`.
Warnings
- breaking Direct use of `apollo-angular-link-http-common` is strongly discouraged. This package is an internal utility, not intended for public consumption. Its API is unstable and subject to change without notice in any release, including patch versions, making direct usage fragile and prone to breakage.
- gotcha Peer dependency mismatches, particularly with `graphql` versions, can cause issues. The package declares a peer dependency on `graphql` with a complex range (`>=0.11.0 <0.14.0 || ^14.0.0 || ^15.0.0`). Ensure your project's `graphql` version strictly adheres to this range to avoid runtime errors and unexpected behavior.
- breaking Angular version support for this package is implicitly tied to `apollo-angular` major releases. As an internal dependency, it inherits the compatibility matrix of `apollo-angular`. `apollo-angular` regularly drops support for older Angular versions with its major releases (e.g., `apollo-angular@13.0.0` dropped Angular 18, `apollo-angular@11.0.0` dropped Angular 17).
- breaking Consumers of `apollo-angular` (and thus indirectly this package) must be aware of breaking changes from `@apollo/client` v4. `apollo-angular` v12.0.0 introduced a significant breaking change requiring understanding all changes from `@apollo/client` v4, which also applies to the underlying link mechanisms.
Install
-
npm install apollo-angular-link-http-common -
yarn add apollo-angular-link-http-common -
pnpm add apollo-angular-link-http-common
Imports
- AnyExportedSymbol
import { AnyExportedSymbol } from 'apollo-angular-link-http-common';// This package is for internal use only; do not import directly.