Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/khaki-peas-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@apollo/server-integration-testsuite': patch
'@apollo/server': patch
---

Non-major dependency updates
2,021 changes: 760 additions & 1,261 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@
"npm": ">=8.5.0"
},
"devDependencies": {
"@apollo/client": "3.8.9",
"@apollo/gateway": "2.6.3",
"@apollo/subgraph": "2.6.3",
"@apollo/client": "3.10.8",
"@apollo/gateway": "2.8.3",
"@apollo/subgraph": "2.8.3",
"@apollo/utils.createhash": "2.0.1",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@changesets/cli": "2.27.7",
"@graphql-codegen/cli": "3.3.1",
"@graphql-codegen/typescript-operations": "3.0.4",
"@graphql-tools/mock": "8.7.20",
"@graphql-tools/schema": "9.0.19",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-commonjs": "25.0.8",
"@types/async-retry": "1.4.8",
"@types/compression": "1.7.5",
"@types/cors": "2.8.17",
"@types/express": "4.17.21",
"@types/express-serve-static-core": "4.17.41",
"@types/lodash": "4.14.202",
"@types/express-serve-static-core": "4.19.5",
"@types/lodash": "4.17.7",
"@types/lodash.sumby": "4.6.9",
"@types/lodash.xorby": "4.7.9",
"@types/negotiator": "0.6.3",
"@types/node": "14.18.63",
"@types/node-fetch": "2.6.10",
"@types/node-fetch": "2.6.11",
"@types/qs-middleware": "1.0.4",
"@types/retry": "0.12.5",
"@types/superagent": "4.1.24",
"@types/supertest": "2.0.16",
"@types/test-listen": "1.1.2",
"@types/type-is": "1.6.6",
"@types/uuid": "9.0.7",
"@types/uuid": "9.0.8",
"@types/whatwg-mimetype": "3.0.2",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
Expand All @@ -76,10 +76,10 @@
"compression": "1.7.4",
"cors": "2.8.5",
"cspell": "6.31.3",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"express": "4.19.2",
"graphql": "16.8.1",
"graphql": "16.9.0",
"graphql-subscriptions": "2.0.0",
"graphql-tag": "2.12.6",
"jest": "29.7.0",
Expand All @@ -89,16 +89,16 @@
"jest-mock-random": "1.1.1",
"jest-serializer-html": "7.1.0",
"lodash.sumby": "4.6.0",
"nock": "13.4.0",
"nock": "13.5.4",
"node-fetch": "2.7.0",
"prettier": "3.1.1",
"prettier": "3.3.3",
"prettier-2": "npm:prettier@2.8.8",
"qs-middleware": "1.0.3",
"requisition": "1.7.0",
"rollup": "3.29.4",
"supertest": "6.3.3",
"supertest": "6.3.4",
"test-listen": "1.1.0",
"ts-jest": "29.1.1",
"ts-jest": "29.2.3",
"typescript": "5.4.2"
},
"jest": {
Expand All @@ -107,7 +107,7 @@
]
},
"volta": {
"node": "20.11.0",
"npm": "9.9.2"
"node": "20.15.1",
"npm": "9.9.3"
}
}
33 changes: 15 additions & 18 deletions packages/server/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ export class ApolloServer<in out TContext extends BaseContext = BaseContext> {
? recommendedCsrfPreventionRequestHeaders
: config.csrfPrevention === false
? null
: config.csrfPrevention.requestHeaders ??
recommendedCsrfPreventionRequestHeaders,
: (config.csrfPrevention.requestHeaders ??
recommendedCsrfPreventionRequestHeaders),
status400ForVariableCoercionErrors:
config.status400ForVariableCoercionErrors ?? false,
__testing_incrementalExecutionResults:
Expand Down Expand Up @@ -507,8 +507,8 @@ export class ApolloServer<in out TContext extends BaseContext = BaseContext> {

try {
await Promise.all(
this.internals.plugins.map(
async (plugin) => plugin.startupDidFail?.({ error }),
this.internals.plugins.map(async (plugin) =>
plugin.startupDidFail?.({ error }),
),
);
} catch (pluginError) {
Expand Down Expand Up @@ -1062,11 +1062,10 @@ export class ApolloServer<in out TContext extends BaseContext = BaseContext> {
const error = ensureError(maybeError);
try {
await Promise.all(
this.internals.plugins.map(
async (plugin) =>
plugin.contextCreationDidFail?.({
error,
}),
this.internals.plugins.map(async (plugin) =>
plugin.contextCreationDidFail?.({
error,
}),
),
);
} catch (pluginError) {
Expand Down Expand Up @@ -1099,9 +1098,8 @@ export class ApolloServer<in out TContext extends BaseContext = BaseContext> {
) {
try {
await Promise.all(
this.internals.plugins.map(
async (plugin) =>
plugin.invalidRequestWasReceived?.({ error: maybeError }),
this.internals.plugins.map(async (plugin) =>
plugin.invalidRequestWasReceived?.({ error: maybeError }),
),
);
} catch (pluginError) {
Expand Down Expand Up @@ -1323,12 +1321,11 @@ export async function internalExecuteOperation<TContext extends BaseContext>(
// If *these* hooks throw then we'll still get a 500 but won't mask its
// error.
await Promise.all(
internals.plugins.map(
async (plugin) =>
plugin.unexpectedErrorProcessingRequest?.({
requestContext,
error,
}),
internals.plugins.map(async (plugin) =>
plugin.unexpectedErrorProcessingRequest?.({
requestContext,
error,
}),
),
);
// Mask unexpected error externally.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const getEmbeddedSandboxHTML = (
runTelemetry: true,
endpointIsEditable: false,
initialState: {},
...(typeof config.embed === 'boolean' ? {} : config.embed ?? {}),
...(typeof config.embed === 'boolean' ? {} : (config.embed ?? {})),
};
const embeddedSandboxConfig = {
target: '#embeddableSandbox',
Expand Down
72 changes: 32 additions & 40 deletions packages/server/src/requestPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,10 @@ export async function processGraphQLRequest<TContext extends BaseContext>(
// syntactically correct, so this string should not be trusted as a valid
// document until after it's parsed and validated.
await Promise.all(
requestListeners.map(
(l) =>
l.didResolveSource?.(
requestContext as GraphQLRequestContextDidResolveSource<TContext>,
),
requestListeners.map((l) =>
l.didResolveSource?.(
requestContext as GraphQLRequestContextDidResolveSource<TContext>,
),
),
);

Expand Down Expand Up @@ -323,11 +322,10 @@ export async function processGraphQLRequest<TContext extends BaseContext>(

try {
await Promise.all(
requestListeners.map(
(l) =>
l.didResolveOperation?.(
requestContext as GraphQLRequestContextDidResolveOperation<TContext>,
),
requestListeners.map((l) =>
l.didResolveOperation?.(
requestContext as GraphQLRequestContextDidResolveOperation<TContext>,
),
),
);
} catch (err: unknown) {
Expand Down Expand Up @@ -376,11 +374,10 @@ export async function processGraphQLRequest<TContext extends BaseContext>(
} else {
const executionListeners = (
await Promise.all(
requestListeners.map(
(l) =>
l.executionDidStart?.(
requestContext as GraphQLRequestContextExecutionDidStart<TContext>,
),
requestListeners.map((l) =>
l.executionDidStart?.(
requestContext as GraphQLRequestContextExecutionDidStart<TContext>,
),
),
)
).filter(isDefined);
Expand All @@ -392,9 +389,8 @@ export async function processGraphQLRequest<TContext extends BaseContext>(
// symbol so it can be invoked by our `wrapField` method during execution.
const invokeWillResolveField: GraphQLRequestExecutionListener<TContext>['willResolveField'] =
(...args) =>
invokeSyncDidStartHook(
executionListeners,
(l) => l.willResolveField?.(...args),
invokeSyncDidStartHook(executionListeners, (l) =>
l.willResolveField?.(...args),
);

Object.defineProperty(
Expand Down Expand Up @@ -583,12 +579,11 @@ export async function processGraphQLRequest<TContext extends BaseContext>(
const { errors } = incrementalResult;
if (errors) {
await Promise.all(
requestListeners.map(
(l) =>
l.didEncounterSubsequentErrors?.(
requestContext as GraphQLRequestContextDidEncounterSubsequentErrors<TContext>,
errors,
),
requestListeners.map((l) =>
l.didEncounterSubsequentErrors?.(
requestContext as GraphQLRequestContextDidEncounterSubsequentErrors<TContext>,
errors,
),
),
);

Expand All @@ -608,12 +603,11 @@ export async function processGraphQLRequest<TContext extends BaseContext>(

// Invoke hook, which is allowed to mutate payload if it really wants to.
await Promise.all(
requestListeners.map(
(l) =>
l.willSendSubsequentPayload?.(
requestContext as GraphQLRequestContextWillSendSubsequentPayload<TContext>,
payload,
),
requestListeners.map((l) =>
l.willSendSubsequentPayload?.(
requestContext as GraphQLRequestContextWillSendSubsequentPayload<TContext>,
payload,
),
),
);

Expand All @@ -623,11 +617,10 @@ export async function processGraphQLRequest<TContext extends BaseContext>(

async function invokeWillSendResponse() {
await Promise.all(
requestListeners.map(
(l) =>
l.willSendResponse?.(
requestContext as GraphQLRequestContextWillSendResponse<TContext>,
),
requestListeners.map((l) =>
l.willSendResponse?.(
requestContext as GraphQLRequestContextWillSendResponse<TContext>,
),
),
);
}
Expand All @@ -638,11 +631,10 @@ export async function processGraphQLRequest<TContext extends BaseContext>(
requestContext.errors = errors;

return await Promise.all(
requestListeners.map(
(l) =>
l.didEncounterErrors?.(
requestContext as GraphQLRequestContextDidEncounterErrors<TContext>,
),
requestListeners.map((l) =>
l.didEncounterErrors?.(
requestContext as GraphQLRequestContextDidEncounterErrors<TContext>,
),
),
);
}
Expand Down
37 changes: 25 additions & 12 deletions smoke-test/package-lock.json

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

6 changes: 3 additions & 3 deletions smoke-test/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"graphql": "16.8.1",
"make-fetch-happen": "13.0.0"
"graphql": "16.9.0",
"make-fetch-happen": "13.0.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-commonjs": "25.0.8",
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-node-resolve": "15.2.3",
"@types/make-fetch-happen": "10.0.4",
Expand Down