@envelop/extended-validation
Advanced tools
Comparing version 1.2.0-alpha-d7e3951.0 to 1.2.0-alpha-d9602a7.0
@@ -6,3 +6,3 @@ 'use strict'; | ||
const graphql = require('graphql'); | ||
const values = require('graphql/execution/values'); | ||
const utils = require('@graphql-tools/utils'); | ||
@@ -75,7 +75,7 @@ const SYMBOL_EXTENDED_VALIDATION_RULES = Symbol('SYMBOL_EXTENDED_VALIDATION_RULES'); | ||
} | ||
const values$1 = values.getArgumentValues(fieldType, node, executionArgs.variableValues); | ||
const values = utils.getArgumentValues(fieldType, node, executionArgs.variableValues || undefined); | ||
if (fieldType) { | ||
const isOneOfFieldType = ((_b = fieldType.extensions) === null || _b === void 0 ? void 0 : _b.oneOf) || (fieldType.astNode && getDirectiveFromAstNode(fieldType.astNode, 'oneOf')); | ||
if (isOneOfFieldType) { | ||
if (Object.keys(values$1).length !== 1) { | ||
if (Object.keys(values).length !== 1) { | ||
validationContext.reportError(new graphql.GraphQLError(`Exactly one key must be specified for input for field "${fieldType.type.toString()}.${node.name.value}"`, [node])); | ||
@@ -88,3 +88,3 @@ } | ||
if (argType) { | ||
traverseVariables(validationContext, arg, argType.type, values$1[arg.name.value]); | ||
traverseVariables(validationContext, arg, argType.type, values[arg.name.value]); | ||
} | ||
@@ -91,0 +91,0 @@ } |
{ | ||
"name": "@envelop/extended-validation", | ||
"version": "1.2.0-alpha-d7e3951.0", | ||
"version": "1.2.0-alpha-d9602a7.0", | ||
"sideEffects": false, | ||
@@ -8,2 +8,5 @@ "peerDependencies": { | ||
}, | ||
"dependencies": { | ||
"@graphql-tools/utils": "8.5.0" | ||
}, | ||
"repository": { | ||
@@ -10,0 +13,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
16980
2
+ Added@graphql-tools/utils@8.5.0
+ Added@graphql-tools/utils@8.5.0(transitive)
+ Addedtslib@2.3.1(transitive)