@apollo/server
Advanced tools
Comparing version 4.10.5 to 4.11.0
@@ -62,2 +62,3 @@ import type { GatewayExecutor } from '@apollo/server-gateway-interface'; | ||
validationRules: Array<ValidationRule>; | ||
hideSchemaDetailsFromClientErrors: boolean; | ||
fieldResolver?: GraphQLFieldResolver<any, TContext>; | ||
@@ -64,0 +65,0 @@ status400ForVariableCoercionErrors?: boolean; |
@@ -103,2 +103,3 @@ "use strict"; | ||
const introspectionEnabled = config.introspection ?? isDev; | ||
const hideSchemaDetailsFromClientErrors = config.hideSchemaDetailsFromClientErrors ?? false; | ||
this.cache = | ||
@@ -115,2 +116,3 @@ config.cache === undefined || config.cache === 'bounded' | ||
], | ||
hideSchemaDetailsFromClientErrors, | ||
dangerouslyDisableValidation: config.dangerouslyDisableValidation ?? false, | ||
@@ -402,3 +404,3 @@ fieldResolver: config.fieldResolver, | ||
async addDefaultPlugins() { | ||
const { plugins, apolloConfig, nodeEnv } = this.internals; | ||
const { plugins, apolloConfig, nodeEnv, hideSchemaDetailsFromClientErrors, } = this.internals; | ||
const isDev = nodeEnv !== 'production'; | ||
@@ -489,2 +491,9 @@ const alreadyHavePluginWithInternalId = (id) => plugins.some((p) => (0, internalPlugin_js_1.pluginIsInternal)(p) && p.__internal_plugin_id__ === id); | ||
} | ||
{ | ||
const alreadyHavePlugin = alreadyHavePluginWithInternalId('DisableSuggestions'); | ||
if (hideSchemaDetailsFromClientErrors && !alreadyHavePlugin) { | ||
const { ApolloServerPluginDisableSuggestions } = await Promise.resolve().then(() => __importStar(require('./plugin/disableSuggestions/index.js'))); | ||
plugins.push(ApolloServerPluginDisableSuggestions()); | ||
} | ||
} | ||
} | ||
@@ -491,0 +500,0 @@ addPlugin(plugin) { |
@@ -39,2 +39,3 @@ import type { Logger } from '@apollo/utils.logger'; | ||
introspection?: boolean; | ||
hideSchemaDetailsFromClientErrors?: boolean; | ||
plugins?: ApolloServerPlugin<TContext>[]; | ||
@@ -41,0 +42,0 @@ persistedQueries?: PersistedQueryOptions | false; |
@@ -1,2 +0,2 @@ | ||
export declare const packageVersion = "4.10.5"; | ||
export declare const packageVersion = "4.11.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.packageVersion = void 0; | ||
exports.packageVersion = "4.10.5"; | ||
exports.packageVersion = "4.11.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -7,4 +7,4 @@ import type { BaseContext, ApolloServerPlugin } from './externalTypes/index.js'; | ||
export declare function internalPlugin<TContext extends BaseContext>(p: InternalApolloServerPlugin<TContext>): ApolloServerPlugin<TContext>; | ||
export type InternalPluginId = 'CacheControl' | 'LandingPageDisabled' | 'SchemaReporting' | 'InlineTrace' | 'UsageReporting'; | ||
export type InternalPluginId = 'CacheControl' | 'LandingPageDisabled' | 'SchemaReporting' | 'InlineTrace' | 'UsageReporting' | 'DisableSuggestions'; | ||
export declare function pluginIsInternal<TContext extends BaseContext>(plugin: ApolloServerPlugin<TContext>): plugin is InternalApolloServerPlugin<TContext>; | ||
//# sourceMappingURL=internalPlugin.d.ts.map |
@@ -62,2 +62,3 @@ import type { GatewayExecutor } from '@apollo/server-gateway-interface'; | ||
validationRules: Array<ValidationRule>; | ||
hideSchemaDetailsFromClientErrors: boolean; | ||
fieldResolver?: GraphQLFieldResolver<any, TContext>; | ||
@@ -64,0 +65,0 @@ status400ForVariableCoercionErrors?: boolean; |
@@ -74,2 +74,3 @@ import { isNodeLike } from '@apollo/utils.isnodelike'; | ||
const introspectionEnabled = config.introspection ?? isDev; | ||
const hideSchemaDetailsFromClientErrors = config.hideSchemaDetailsFromClientErrors ?? false; | ||
this.cache = | ||
@@ -86,2 +87,3 @@ config.cache === undefined || config.cache === 'bounded' | ||
], | ||
hideSchemaDetailsFromClientErrors, | ||
dangerouslyDisableValidation: config.dangerouslyDisableValidation ?? false, | ||
@@ -373,3 +375,3 @@ fieldResolver: config.fieldResolver, | ||
async addDefaultPlugins() { | ||
const { plugins, apolloConfig, nodeEnv } = this.internals; | ||
const { plugins, apolloConfig, nodeEnv, hideSchemaDetailsFromClientErrors, } = this.internals; | ||
const isDev = nodeEnv !== 'production'; | ||
@@ -460,2 +462,9 @@ const alreadyHavePluginWithInternalId = (id) => plugins.some((p) => pluginIsInternal(p) && p.__internal_plugin_id__ === id); | ||
} | ||
{ | ||
const alreadyHavePlugin = alreadyHavePluginWithInternalId('DisableSuggestions'); | ||
if (hideSchemaDetailsFromClientErrors && !alreadyHavePlugin) { | ||
const { ApolloServerPluginDisableSuggestions } = await import('./plugin/disableSuggestions/index.js'); | ||
plugins.push(ApolloServerPluginDisableSuggestions()); | ||
} | ||
} | ||
} | ||
@@ -462,0 +471,0 @@ addPlugin(plugin) { |
@@ -39,2 +39,3 @@ import type { Logger } from '@apollo/utils.logger'; | ||
introspection?: boolean; | ||
hideSchemaDetailsFromClientErrors?: boolean; | ||
plugins?: ApolloServerPlugin<TContext>[]; | ||
@@ -41,0 +42,0 @@ persistedQueries?: PersistedQueryOptions | false; |
@@ -1,2 +0,2 @@ | ||
export declare const packageVersion = "4.10.5"; | ||
export declare const packageVersion = "4.11.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export const packageVersion = "4.10.5"; | ||
export const packageVersion = "4.11.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -7,4 +7,4 @@ import type { BaseContext, ApolloServerPlugin } from './externalTypes/index.js'; | ||
export declare function internalPlugin<TContext extends BaseContext>(p: InternalApolloServerPlugin<TContext>): ApolloServerPlugin<TContext>; | ||
export type InternalPluginId = 'CacheControl' | 'LandingPageDisabled' | 'SchemaReporting' | 'InlineTrace' | 'UsageReporting'; | ||
export type InternalPluginId = 'CacheControl' | 'LandingPageDisabled' | 'SchemaReporting' | 'InlineTrace' | 'UsageReporting' | 'DisableSuggestions'; | ||
export declare function pluginIsInternal<TContext extends BaseContext>(plugin: ApolloServerPlugin<TContext>): plugin is InternalApolloServerPlugin<TContext>; | ||
//# sourceMappingURL=internalPlugin.d.ts.map |
{ | ||
"name": "@apollo/server", | ||
"version": "4.10.5", | ||
"version": "4.11.0", | ||
"description": "Core engine for Apollo GraphQL server", | ||
@@ -58,2 +58,10 @@ "type": "module", | ||
}, | ||
"./plugin/disableSuggestions": { | ||
"types": { | ||
"require": "./dist/cjs/plugin/disableSuggestions/index.d.ts", | ||
"default": "./dist/esm/plugin/disableSuggestions/index.d.ts" | ||
}, | ||
"import": "./dist/esm/plugin/disableSuggestions/index.js", | ||
"require": "./dist/cjs/plugin/disableSuggestions/index.js" | ||
}, | ||
"./plugin/drainHttpServer": { | ||
@@ -60,0 +68,0 @@ "types": { |
@@ -178,2 +178,3 @@ import type { GatewayExecutor } from '@apollo/server-gateway-interface'; | ||
validationRules: Array<ValidationRule>; | ||
hideSchemaDetailsFromClientErrors: boolean; | ||
fieldResolver?: GraphQLFieldResolver<any, TContext>; | ||
@@ -285,2 +286,4 @@ // TODO(AS5): remove OR warn + ignore with this option set, ignore option and | ||
const introspectionEnabled = config.introspection ?? isDev; | ||
const hideSchemaDetailsFromClientErrors = | ||
config.hideSchemaDetailsFromClientErrors ?? false; | ||
@@ -303,2 +306,3 @@ // We continue to allow 'bounded' for backwards-compatibility with the AS3.9 | ||
], | ||
hideSchemaDetailsFromClientErrors, | ||
dangerouslyDisableValidation: | ||
@@ -840,3 +844,8 @@ config.dangerouslyDisableValidation ?? false, | ||
private async addDefaultPlugins() { | ||
const { plugins, apolloConfig, nodeEnv } = this.internals; | ||
const { | ||
plugins, | ||
apolloConfig, | ||
nodeEnv, | ||
hideSchemaDetailsFromClientErrors, | ||
} = this.internals; | ||
const isDev = nodeEnv !== 'production'; | ||
@@ -1000,2 +1009,13 @@ | ||
} | ||
{ | ||
const alreadyHavePlugin = | ||
alreadyHavePluginWithInternalId('DisableSuggestions'); | ||
if (hideSchemaDetailsFromClientErrors && !alreadyHavePlugin) { | ||
const { ApolloServerPluginDisableSuggestions } = await import( | ||
'./plugin/disableSuggestions/index.js' | ||
); | ||
plugins.push(ApolloServerPluginDisableSuggestions()); | ||
} | ||
} | ||
} | ||
@@ -1002,0 +1022,0 @@ |
@@ -96,2 +96,3 @@ /** | ||
introspection?: boolean; | ||
hideSchemaDetailsFromClientErrors?: boolean; | ||
plugins?: ApolloServerPlugin<TContext>[]; | ||
@@ -98,0 +99,0 @@ persistedQueries?: PersistedQueryOptions | false; |
@@ -1,1 +0,1 @@ | ||
export const packageVersion = "4.10.5"; | ||
export const packageVersion = "4.11.0"; |
@@ -33,3 +33,4 @@ import type { BaseContext, ApolloServerPlugin } from './externalTypes/index.js'; | ||
| 'InlineTrace' | ||
| 'UsageReporting'; | ||
| 'UsageReporting' | ||
| 'DisableSuggestions'; | ||
@@ -36,0 +37,0 @@ export function pluginIsInternal<TContext extends BaseContext>( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1963181
530
34536