Skip to content

Commit

Permalink
Merge pull request #1793 from apollographql/trevor/backport-1792
Browse files Browse the repository at this point in the history
Remove HttpRequestCache (`version-0.x`)
  • Loading branch information
trevor-scheer authored Apr 27, 2022
2 parents c8cae53 + bc8db4e commit 9d00005
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 69 deletions.
2 changes: 1 addition & 1 deletion gateway-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This CHANGELOG pertains only to Apollo Federation packages in the `0.x` range. T

> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. When a release is being prepared, a new header will be (manually)
- Nothing yet! Stay tuned.
- The `fetch` implementation returned by `getDefaultFetcher` no longer performs in-memory caching. This fetcher is currently only used by `@apollo/gateway` to make uncacheable `POST` requests to Uplink, so this is a no-op for Gateway's own behavior, but if you used the function returned `getDefaultFetcher` in your own code to perform `GET` requests against servers that return cache-related response headers, it will no longer cache results. You can use the underlying [`make-fetch-happen`](https://www.npmjs.com/package/make-fetch-happen) package directly to use its cache capabilities instead of using the function returned by `getDefaultFetcher`. [PR #1792](https://github.com/apollographql/federation/pull/1792)

## v0.50.2

Expand Down
66 changes: 0 additions & 66 deletions gateway-js/src/cache.ts

This file was deleted.

2 changes: 0 additions & 2 deletions gateway-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
import { RemoteGraphQLDataSource } from './datasources/RemoteGraphQLDataSource';
import { getVariableValues } from 'graphql/execution/values';
import fetcher from 'make-fetch-happen';
import { HttpRequestCache } from './cache';
import { fetch } from 'apollo-server-env';
import {
QueryPlanner,
Expand Down Expand Up @@ -86,7 +85,6 @@ type WarnedStates = {
export function getDefaultFetcher() {
const { name, version } = require('../package.json');
return fetcher.defaults({
cacheManager: new HttpRequestCache(),
// All headers should be lower-cased here, as `make-fetch-happen`
// treats differently cased headers as unique (unlike the `Headers` object).
// @see: https://git.io/JvRUa
Expand Down

0 comments on commit 9d00005

Please sign in to comment.