Skip to content

Commit

Permalink
enhance(delegate): skip validation by default and add validateRequest…
Browse files Browse the repository at this point in the history
… option to enable
  • Loading branch information
ardatan committed Jun 30, 2021
1 parent 672833b commit aa43054
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-glasses-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/delegate': major
---

BREAKING CHANGE: validations are skipped by default, use validateRequest: true to reenable
2 changes: 1 addition & 1 deletion packages/delegate/src/delegateToSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function delegateRequest<TContext = Record<string, any>, TArgs = any>(

const processedRequest = transformer.transformRequest(options.request);

if (!options.skipValidation) {
if (options.validateRequest) {
validateRequest(delegationContext, processedRequest.document);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/delegate/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface IDelegateToSchemaOptions<TContext = Record<string, any>, TArgs
rootValue?: Record<string, any>;
transforms?: Array<Transform<any, TContext>>;
transformedSchema?: GraphQLSchema;
skipValidation?: boolean;
validateRequest?: boolean;
skipTypeMerging?: boolean;
binding?: DelegationBinding<TContext>;
}
Expand Down

0 comments on commit aa43054

Please sign in to comment.