Skip to content

Commit f0bce3e

Browse files
committed
feat: update dependencies
1 parent a80d91f commit f0bce3e

11 files changed

+1570
-832
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
],
4040
"@typescript-eslint/explicit-function-return-type": "error",
4141
"@typescript-eslint/explicit-member-accessibility": "off",
42+
"no-restricted-exports": "off",
4243
"@typescript-eslint/no-unused-vars": [
4344
"error",
4445
{

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [12.x]
19+
node-version: [16.x, 14.x]
2020

2121
steps:
2222
- uses: actions/checkout@v2
@@ -36,7 +36,6 @@ jobs:
3636
${{ runner.os }}-yarn-
3737
- run: cp .env.example .env
3838
- run: yarn --frozen-lockfile
39-
- run: yarn install-peers -f
4039
- run: yarn lint
4140
- run: yarn build
4241
- run: yarn test

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn run commitlint --edit $1

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn run lint && yarn run test --coverage

.husky/pre-push

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn run lint && yarn run test --coverage

lib/FileUploadDataSource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export default class FileUploadDataSource extends RemoteGraphQLDataSource {
222222
let httpResponse: Response | undefined;
223223

224224
try {
225-
httpResponse = await this.fetcher(httpRequest);
225+
httpResponse = await this.fetcher(request.http.url, options);
226226

227227
const body = await this.parseBody(httpResponse);
228228

package.json

+31-29
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"check-types": "tsc --noEmit",
1212
"run-lint": "eslint --max-warnings=0 --ext .ts lib",
1313
"lint": "run-s check-types run-lint",
14-
"install-peers": "install-peers -f",
1514
"build": "tsc",
1615
"prepublishOnly": "tsc",
1716
"test": "nyc ts-node -r dotenv-safe/config ./test/index.ts"
@@ -22,10 +21,10 @@
2221
"lodash.set": "^4.3.2"
2322
},
2423
"peerDependencies": {
25-
"@apollo/gateway": "^0.41.0",
26-
"apollo-server-env": "^4.0.3",
27-
"apollo-server-types": "^3.2.0",
28-
"graphql-upload": "^12.0.0"
24+
"@apollo/gateway": "^0.46.0",
25+
"apollo-server-env": "^4.2.1",
26+
"apollo-server-types": "^3.5.1",
27+
"graphql-upload": "^13.0.0"
2928
},
3029
"husky": {
3130
"hooks": {
@@ -35,38 +34,41 @@
3534
}
3635
},
3736
"devDependencies": {
38-
"@apollo/federation": "^0.32.0",
39-
"@commitlint/cli": "^13.1.0",
40-
"@commitlint/config-angular": "^13.1.0",
41-
"@istanbuljs/nyc-config-typescript": "^1.0.1",
42-
"@types/graphql-upload": "^8.0.7",
37+
"@apollo/gateway": "^0.46.0",
38+
"apollo-server-env": "^4.2.1",
39+
"apollo-server-types": "^3.5.1",
40+
"graphql-upload": "^13.0.0",
41+
"@apollo/federation": "^0.33.9",
42+
"@commitlint/cli": "^16.1.0",
43+
"@commitlint/config-angular": "^16.0.0",
44+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
45+
"@types/graphql-upload": "^8.0.10",
4346
"@types/lodash.clonedeep": "^4.5.6",
4447
"@types/lodash.set": "^4.3.6",
4548
"@types/newman": "^5.1.4",
46-
"@types/node": "^16.9.1",
47-
"@typescript-eslint/eslint-plugin": "^4.31.0",
48-
"@typescript-eslint/parser": "^4.31.0",
49-
"apollo-graphql": "^0.9.3",
50-
"apollo-server-core": "^3.3.0",
51-
"apollo-server-express": "^3.3.0",
49+
"@types/node": "^17.0.10",
50+
"@typescript-eslint/eslint-plugin": "^5.10.0",
51+
"@typescript-eslint/parser": "^5.10.0",
52+
"apollo-graphql": "^0.9.5",
53+
"apollo-server-core": "^3.6.2",
54+
"apollo-server-express": "^3.6.2",
5255
"dotenv-safe": "^8.2.0",
53-
"eslint": "^7.32.0",
54-
"eslint-config-airbnb-base": "^14.2.1",
56+
"eslint": "^8.7.0",
57+
"eslint-config-airbnb-base": "^15.0.0",
5558
"eslint-config-prettier": "^8.3.0",
56-
"eslint-import-resolver-typescript": "^2.4.0",
59+
"eslint-import-resolver-typescript": "^2.5.0",
5760
"eslint-plugin-filenames": "^1.3.2",
58-
"eslint-plugin-import": "^2.24.2",
61+
"eslint-plugin-import": "^2.25.4",
5962
"eslint-plugin-prettier": "^4.0.0",
60-
"express": "4.17.1",
61-
"graphql": "^15.5.3",
62-
"husky": "^7.0.0",
63-
"install-peers-cli": "^2.2.0",
64-
"newman": "^5.3.0",
63+
"express": "4.17.2",
64+
"graphql": "^15.7.2",
65+
"husky": "^7.0.4",
66+
"newman": "^5.3.1",
6567
"npm-run-all": "^4.1.5",
6668
"nyc": "^15.1.0",
67-
"prettier": "^2.4.0",
68-
"source-map-support": "^0.5.20",
69-
"ts-node": "^10.2.1",
70-
"typescript": "^4.2.3"
69+
"prettier": "^2.5.1",
70+
"source-map-support": "^0.5.21",
71+
"ts-node": "^10.4.0",
72+
"typescript": "^4.5.5"
7173
}
7274
}

test/gateway.ts

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ApolloServer } from 'apollo-server-express';
2-
import { ApolloGateway } from '@apollo/gateway';
3-
import { ApolloServerPluginInlineTraceDisabled } from 'apollo-server-core';
2+
import { ApolloGateway, IntrospectAndCompose } from '@apollo/gateway';
3+
import {
4+
ApolloServerPluginInlineTraceDisabled,
5+
ApolloServerPluginLandingPageDisabled,
6+
} from 'apollo-server-core';
47
import express from 'express';
58
import { graphqlUploadExpress } from 'graphql-upload';
69
import http from 'http';
@@ -23,22 +26,27 @@ const gateway = async (): Promise<
2326
useChunkedTransfer:
2427
url?.includes(CHUNKED_DOWNLOAD_SERVICE_PORT) ?? true,
2528
}),
26-
serviceList: [
27-
{
28-
name: 'chunked-download',
29-
url: `http://localhost:${CHUNKED_DOWNLOAD_SERVICE_PORT}/graphql`,
30-
},
31-
{
32-
name: 'download',
33-
url: `http://localhost:${DOWNLOAD_SERVICE_PORT}/graphql`,
34-
},
35-
],
29+
supergraphSdl: new IntrospectAndCompose({
30+
subgraphs: [
31+
{
32+
name: 'chunked-download',
33+
url: `http://localhost:${CHUNKED_DOWNLOAD_SERVICE_PORT}/graphql`,
34+
},
35+
{
36+
name: 'download',
37+
url: `http://localhost:${DOWNLOAD_SERVICE_PORT}/graphql`,
38+
},
39+
],
40+
}),
3641
});
3742
const app = express();
3843
app.use(graphqlUploadExpress());
3944
const server = new ApolloServer({
4045
gateway: apolloGateway,
41-
plugins: [ApolloServerPluginInlineTraceDisabled()],
46+
plugins: [
47+
ApolloServerPluginInlineTraceDisabled(),
48+
ApolloServerPluginLandingPageDisabled(),
49+
],
4250
});
4351
await server.start();
4452
server.applyMiddleware({ app, path: '/' });

test/gen-service.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { ApolloServer, gql } from 'apollo-server-express';
2-
import { buildFederatedSchema } from '@apollo/federation';
2+
import { buildSubgraphSchema } from '@apollo/federation';
33
import {
44
FileUpload,
55
graphqlUploadExpress,
66
GraphQLUpload,
77
} from 'graphql-upload';
88
import { GraphQLResolverMap } from 'apollo-graphql';
9-
import { ApolloServerPluginInlineTraceDisabled } from 'apollo-server-core';
9+
import {
10+
ApolloServerPluginInlineTraceDisabled,
11+
ApolloServerPluginLandingPageDisabled,
12+
} from 'apollo-server-core';
1013
import express from 'express';
1114
import http from 'http';
1215

@@ -128,16 +131,19 @@ const genService = (
128131
const app = express();
129132
app.use(graphqlUploadExpress());
130133
const server = new ApolloServer({
131-
plugins: [ApolloServerPluginInlineTraceDisabled()],
132-
schema: buildFederatedSchema([
134+
plugins: [
135+
ApolloServerPluginInlineTraceDisabled(),
136+
ApolloServerPluginLandingPageDisabled(),
137+
],
138+
schema: buildSubgraphSchema([
133139
{
134140
resolvers,
135141
typeDefs,
136142
},
137143
]),
138144
});
139145
await server.start();
140-
server.applyMiddleware({ app });
146+
server.applyMiddleware({ app, path: '/graphql' });
141147

142148
const expressServer = await new Promise<http.Server>(resolve => {
143149
const s = app.listen(

test/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const { GATEWAY_PORT = '4000', MAX_CONNECT_RETRIES = '5' } = process.env;
1313
const maxRetries = parseInt(MAX_CONNECT_RETRIES, 10);
1414

1515
const sleep = (milliseconds: number): Promise<void> =>
16-
new Promise(resolve => setTimeout(resolve, milliseconds));
16+
new Promise(resolve => {
17+
setTimeout(resolve, milliseconds);
18+
});
1719

1820
const runTests = (): Promise<void> =>
1921
new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)