Skip to content

Commit

Permalink
Rename option from disableValidation to dangerouslyDisableValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
ganemone committed Nov 13, 2023
1 parent 11f5981 commit 4745ebe
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/source/api/apollo-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ An array containing custom functions to use as additional [validation rules](htt
<tr>
<td>

##### `disableValidation`
##### `dangerouslyDisableValidation`

`Boolean`
</td>
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ export class ApolloServerBase<
logger: this.logger,
plugins: this.plugins,
documentStore,
disableValidation: this.config.disableValidation,
dangerouslyDisableValidation: this.config.dangerouslyDisableValidation,
context,
parseOptions: this.parseOptions,
...this.requestOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/graphqlOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface GraphQLServerOptions<
persistedQueries?: PersistedQueryOptions;
plugins?: ApolloServerPlugin[];
documentStore?: DocumentStore | null;
disableValidation?: boolean;
dangerouslyDisableValidation?: boolean;
parseOptions?: ParseOptions;
nodeEnv?: string;
allowBatchedHttpRequests?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-core/src/requestPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface GraphQLRequestPipelineConfig<TContext> {
) => GraphQLResponse | null;

plugins?: ApolloServerPlugin[];
disableValidation?: boolean;
dangerouslyDisableValidation?: boolean;
documentStore?: DocumentStore | null;

parseOptions?: ParseOptions;
Expand Down Expand Up @@ -258,7 +258,7 @@ export async function processGraphQLRequest<TContext extends BaseContext>(
return await sendErrorResponse(syntaxError as GraphQLError, SyntaxError);
}

if (config.disableValidation !== true) {
if (config.dangerouslyDisableValidation !== true) {
const validationDidEnd = await dispatcher.invokeDidStartHook(
'validationDidStart',
requestContext as GraphQLRequestContextValidationDidStart<TContext>,
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/runHttpQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export async function runHttpQuery(
// passed in.
cache: options.cache!,
dataSources: options.dataSources,
disableValidation: options.disableValidation,
dangerouslyDisableValidation: options.dangerouslyDisableValidation,
documentStore: options.documentStore,

persistedQueries: options.persistedQueries,
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export interface Config<ContextFunctionParams = any> extends BaseConfig {
stopOnTerminationSignals?: boolean;
apollo?: ApolloConfigInput;
nodeEnv?: string;
disableValidation?: boolean;
dangerouslyDisableValidation?: boolean;
documentStore?: DocumentStore | null;
csrfPrevention?: CSRFPreventionOptions | boolean;
cache?: KeyValueCache | 'bounded';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export function testApolloServer<AS extends ApolloServerBase>(
stopOnTerminationSignals: false,
nodeEnv: 'production',
cache: 'bounded',
disableValidation: true,
dangerouslyDisableValidation: true,
});

const apolloFetch = createApolloFetch({ uri });
Expand Down

0 comments on commit 4745ebe

Please sign in to comment.