Skip to content

Commit 12c5e03

Browse files
author
dustin deus
committed
use has instead get
1 parent 4cb939f commit 12c5e03

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/http-data-source.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,8 @@ export abstract class HTTPDataSource<TContext = any> extends DataSource {
308308
if (request.method === 'GET') {
309309
// Memoize GET calls for the same data source instance
310310
// a single instance of the data sources is scoped to one graphql request
311-
const cachedResponse = this.memoizedResults.get(cacheKey)
312-
if (cachedResponse) {
313-
const response = await cachedResponse
311+
if (this.memoizedResults.has(cacheKey)) {
312+
const response = await this.memoizedResults.get(cacheKey)!
314313
response.memoized = true
315314
response.isFromCache = false
316315
return response

0 commit comments

Comments
 (0)