Skip to content

Commit

Permalink
Remove skipLibCheck and add workaround for typing issue in dependency
Browse files Browse the repository at this point in the history
Because `apollo-link-http-common` expects to run in a web environment, it imports the `fetch` type from `WindowOrWorkerGlobalScope`. We should probably either fix that in `apollo-link-http-common` itself, or add `WindowOrWorkerGlobalScope` to `apollo-server-env` like we've done here.
  • Loading branch information
martijnwalraven committed Mar 3, 2021
1 parent 729faad commit 58a88ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions gateway-js/src/__tests__/gateway/reporting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ import { Plugin, Config, Refs } from 'pretty-format';
import { Report } from 'apollo-reporting-protobuf';
import { fixtures } from 'apollo-federation-integration-testsuite';

// TODO: We should fix this another way, but for now adding this
// type declaration here to avoid a typing error in `apollo-link-http-common`
// due to us not dependeing on `dom` (or `webworker`) types.
declare global {
interface WindowOrWorkerGlobalScope {
fetch: typeof import('apollo-server-env')['fetch']
}
}

// Normalize specific fields that change often (eg timestamps) to static values,
// to make snapshot testing viable. (If these helpers are more generally
// useful, they could be moved to a different file.)
Expand Down
1 change: 0 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"noUnusedLocals": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2019", "esnext.asynciterable"],
"skipLibCheck": true,
"types": ["node"],
"baseUrl": ".",
"paths": {
Expand Down

0 comments on commit 58a88ef

Please sign in to comment.