Skip to content

Commit c7cc273

Browse files
Merge pull request #2637 from tugascript/afonso-next
chore: remove deprecated gateway hooks
2 parents da6a44b + 9e1f08a commit c7cc273

File tree

6 files changed

+4
-223
lines changed

6 files changed

+4
-223
lines changed

packages/mercurius/lib/interfaces/mercurius-gateway-driver-config.interface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import {
55
GqlOptionsFactory,
66
} from '@nestjs/graphql';
77
import { MercuriusCommonOptions } from 'mercurius';
8-
import { MercuriusGatewayHooks } from './mercurius-hook.interface';
8+
import { MercuriusHooks } from './mercurius-hook.interface';
99
import { MercuriusPlugins } from './mercurius-plugin.interface';
1010

1111
export type MercuriusGatewayDriverConfig = GqlModuleOptions &
1212
MercuriusCommonOptions &
1313
MercuriusGatewayOptions &
1414
MercuriusPlugins &
15-
MercuriusGatewayHooks;
15+
MercuriusHooks;
1616

1717
export type MercuriusGatewayDriverConfigFactory =
1818
GqlOptionsFactory<MercuriusGatewayDriverConfig>;

packages/mercurius/lib/interfaces/mercurius-hook.interface.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import {
2-
onGatewayReplaceSchemaHookHandler,
3-
preGatewayExecutionHookHandler,
4-
preGatewaySubscriptionExecutionHookHandler,
5-
} from '@mercuriusjs/gateway';
61
import {
72
MercuriusContext,
83
onResolutionHookHandler,
@@ -49,23 +44,3 @@ export interface MercuriusHooks<
4944
> {
5045
hooks?: MercuriusHooksObject<Context>;
5146
}
52-
53-
export interface MercuriusGatewayHooksObject<
54-
Context extends MercuriusContext = MercuriusContext,
55-
> extends MercuriusHooksObject<Context> {
56-
preGatewayExecution?:
57-
| preGatewayExecutionHookHandler<Context>
58-
| preGatewayExecutionHookHandler<Context>[];
59-
preGatewaySubscriptionExecution?:
60-
| preGatewaySubscriptionExecutionHookHandler<Context>
61-
| preGatewaySubscriptionExecutionHookHandler<Context>[];
62-
onGatewayReplaceSchema?:
63-
| onGatewayReplaceSchemaHookHandler
64-
| onGatewayReplaceSchemaHookHandler[];
65-
}
66-
67-
export interface MercuriusGatewayHooks<
68-
Context extends MercuriusContext = MercuriusContext,
69-
> {
70-
hooks?: MercuriusGatewayHooksObject<Context>;
71-
}

packages/mercurius/lib/utils/register-mercurius-hooks.util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { FastifyInstance } from 'fastify';
2-
import { MercuriusGatewayHooksObject } from '../interfaces/mercurius-hook.interface';
2+
import { MercuriusHooksObject } from '../interfaces/mercurius-hook.interface';
33
import { isArray, isNull, isUndefined } from './validation.util';
44

55
export function registerMercuriusHooks(
66
app: FastifyInstance,
7-
hooks?: MercuriusGatewayHooksObject | null,
7+
hooks?: MercuriusHooksObject | null,
88
key: 'graphql' | 'graphqlGateway' = 'graphql',
99
): void {
1010
if (isUndefined(hooks) || isNull(hooks)) {

packages/mercurius/tests/e2e/gateway-hooks.spec.ts

Lines changed: 0 additions & 134 deletions
This file was deleted.

packages/mercurius/tests/hooks/gateway/graphql.config.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

packages/mercurius/tests/hooks/gateway/hooks.module.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)