Skip to content

Commit

Permalink
Remove import of apollo-env.
Browse files Browse the repository at this point in the history
We're only importing `apollo-env`, which is primarily a polyfill library,
for one of its helper utilities.  Inlining these few lines seems like a win.

(The import removed from the `RemoteGraphQLDataSource.test.ts` test was
unused.)
  • Loading branch information
abernix committed Sep 7, 2020
1 parent 4ef79ae commit 3aa1b08
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion gateway-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@apollo/query-planner-wasm": "0.0.2",
"@types/node-fetch": "2.5.4",
"apollo-engine-reporting-protobuf": "^0.5.2",
"apollo-env": "^0.6.1",
"apollo-graphql": "^0.6.0",
"apollo-server-caching": "^0.5.2",
"apollo-server-core": "^2.17.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { RemoteGraphQLDataSource } from '../RemoteGraphQLDataSource';
import { Headers } from 'apollo-server-env';
import { GraphQLRequestContext } from 'apollo-server-types';
import { Response } from '../../../../../../apollo-tooling/packages/apollo-env/lib';

beforeEach(() => {
fetch.mockReset();
Expand Down
6 changes: 5 additions & 1 deletion gateway-js/src/utilities/array.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { isNotNullOrUndefined } from 'apollo-env';
function isNotNullOrUndefined<T>(
value: T | null | undefined,
): value is T {
return value !== null && typeof value !== 'undefined';
}

export function compactMap<T, U>(
array: T[],
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3aa1b08

Please sign in to comment.