apollo-angular-link-http is an Apollo Link implementation designed for Angular applications to facilitate sending GraphQL operations over standard HTTP requests. This package leverages Angular's `HttpClient` (`@angular/common/http`) for network communication. While its last stable version, `1.11.0`, was released over three years ago, its core functionality for creating an HTTP link has largely been integrated and superseded by the primary `apollo-angular` package. As such, `apollo-angular-link-http` is now considered abandoned. Modern Angular and Apollo setups typically configure `HttpLink` directly through `apollo-angular`'s `ApolloClient` creation process, often utilizing `provideApollo()` for dependency injection. This package previously served as a distinct module for HTTP-based GraphQL communication before the `apollo-angular` ecosystem evolved to incorporate this functionality directly.
npm install apollo-angular-link-httpVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up `apollo-angular-link-http` in an Angular `NgModule`, configuring `HttpLink` with a URI and headers, and executing a simple GraphQL query with operation-specific context. Note that this setup relies on older Angular module patterns.
Migrate to `apollo-angular` (e.g., v10+) and use `HttpLink` from `apollo-angular/http`. Configure Apollo Client using `provideApollo()` in standalone components or `app.config.ts` for newer Angular applications, or `Apollo.create()` directly in `AppModule` for older setups.
Upgrade to `apollo-angular` (v10+), which supports a wider range of Angular versions, and remove `apollo-angular-link-http` from your dependencies.
Follow the migration guides for `apollo-angular` and `@apollo/client` when upgrading. Remove this deprecated link package and use the `HttpLink` provided by `apollo-angular` itself.
Ensure your `graphql` dependency aligns with the requirements of `@apollo/client` and `apollo-angular`. If using modern `apollo-angular`, this package should be removed to avoid conflicts.
Ensure the package is installed via `npm install apollo-angular-link-http` or `yarn add apollo-angular-link-http`, and verify the import statement. For modern Angular setups, consider migrating to `apollo-angular`'s built-in `HttpLink`.
If using this package, ensure `HttpLinkModule` is in your `imports` array of the relevant `NgModule`. If using `apollo-angular` v10+, consider replacing `HttpLinkModule` with `HttpLink` from `apollo-angular/http` and configuring it via `provideApollo()`.
Always construct `HttpHeaders` using `new HttpHeaders()` from `@angular/common/http`: `new HttpHeaders().set('Key', 'Value')`.