@envelop/extended-validation
Advanced tools
+5
-0
@@ -24,4 +24,9 @@ 'use strict'; | ||
| onExecute({ args, setResultAndStopExecution }) { | ||
| // We hook into onExecute even though this is a validation pattern. The reasoning behind | ||
| // it is that hooking right after validation and before execution has started is the | ||
| // same as hooking into the validation step. The benefit of this approach is that | ||
| // we may use execution context in the validation rules. | ||
| const rules = args.contextValue[SYMBOL_EXTENDED_VALIDATION_RULES]; | ||
| const errors = []; | ||
| // We replicate the default validation step manually before execution starts. | ||
| const typeInfo = schemaTypeInfo || new graphql.TypeInfo(args.schema); | ||
@@ -28,0 +33,0 @@ const validationContext = new graphql.ValidationContext(args.schema, args.document, typeInfo, e => { |
+5
-0
@@ -20,4 +20,9 @@ import { TypeInfo, ValidationContext, visitInParallel, visit, visitWithTypeInfo, isNonNullType, isListType, GraphQLError, GraphQLInputObjectType } from 'graphql'; | ||
| onExecute({ args, setResultAndStopExecution }) { | ||
| // We hook into onExecute even though this is a validation pattern. The reasoning behind | ||
| // it is that hooking right after validation and before execution has started is the | ||
| // same as hooking into the validation step. The benefit of this approach is that | ||
| // we may use execution context in the validation rules. | ||
| const rules = args.contextValue[SYMBOL_EXTENDED_VALIDATION_RULES]; | ||
| const errors = []; | ||
| // We replicate the default validation step manually before execution starts. | ||
| const typeInfo = schemaTypeInfo || new TypeInfo(args.schema); | ||
@@ -24,0 +29,0 @@ const validationContext = new ValidationContext(args.schema, args.document, typeInfo, e => { |
+3
-2
| { | ||
| "name": "@envelop/extended-validation", | ||
| "version": "1.3.0", | ||
| "version": "1.3.1", | ||
| "sideEffects": false, | ||
@@ -9,3 +9,4 @@ "peerDependencies": { | ||
| "dependencies": { | ||
| "@graphql-tools/utils": "8.5.2" | ||
| "@envelop/core": "^1.6.1", | ||
| "@graphql-tools/utils": "^8.5.3" | ||
| }, | ||
@@ -12,0 +13,0 @@ "repository": { |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { Plugin } from '@envelop/types'; | ||
| import { Plugin } from '@envelop/core'; | ||
| import { ExecutionArgs, ExecutionResult } from 'graphql'; | ||
@@ -3,0 +3,0 @@ import { ExtendedValidationRule } from './common'; |
17695
5.57%276
3.76%3
50%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
Updated