-
Notifications
You must be signed in to change notification settings - Fork 2k
/
index.ts
42 lines (37 loc) 路 1.14 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// TODO(AS4): Document this file
// TODO(AS4): Decide where it is imported from.
import type { BaseContext, ApolloServerPlugin } from '../..';
import type {
InternalApolloServerPlugin,
InternalPluginId,
} from '../../internalPlugin';
function disabledPlugin<TContext extends BaseContext>(
id: InternalPluginId,
): ApolloServerPlugin<TContext> {
const plugin: InternalApolloServerPlugin<TContext> = {
__internal_plugin_id__() {
return id;
},
};
return plugin;
}
export function ApolloServerPluginCacheControlDisabled<
TContext extends BaseContext,
>(): ApolloServerPlugin<TContext> {
return disabledPlugin('CacheControl');
}
export function ApolloServerPluginInlineTraceDisabled<
TContext extends BaseContext,
>(): ApolloServerPlugin<TContext> {
return disabledPlugin('InlineTrace');
}
export function ApolloServerPluginLandingPageDisabled<
TContext extends BaseContext,
>(): ApolloServerPlugin<TContext> {
return disabledPlugin('LandingPageDisabled');
}
export function ApolloServerPluginUsageReportingDisabled<
TContext extends BaseContext,
>(): ApolloServerPlugin<TContext> {
return disabledPlugin('UsageReporting');
}