Comparing version 15.8.0 to 15.9.0
@@ -288,15 +288,26 @@ "use strict"; | ||
for (var _i4 = 0, _Object$keys2 = Object.keys(fields); _i4 < _Object$keys2.length; _i4++) { | ||
var responseName = _Object$keys2[_i4]; | ||
var fieldNodes = fields[responseName]; | ||
var fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); | ||
var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); | ||
try { | ||
for (var _i4 = 0, _Object$keys2 = Object.keys(fields); _i4 < _Object$keys2.length; _i4++) { | ||
var responseName = _Object$keys2[_i4]; | ||
var fieldNodes = fields[responseName]; | ||
var fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); | ||
var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); | ||
if (result !== undefined) { | ||
results[responseName] = result; | ||
if (result !== undefined) { | ||
results[responseName] = result; | ||
if ((0, _isPromise.default)(result)) { | ||
containsPromise = true; | ||
if ((0, _isPromise.default)(result)) { | ||
containsPromise = true; | ||
} | ||
} | ||
} | ||
} catch (error) { | ||
if (containsPromise) { | ||
// Ensure that any promises returned by other fields are handled, as they may also reject. | ||
return (0, _promiseForObject.default)(results).finally(function () { | ||
throw error; | ||
}); | ||
} | ||
throw error; | ||
} // If there are no promises, we can just return the object | ||
@@ -303,0 +314,0 @@ |
@@ -320,2 +320,3 @@ // Minimum TypeScript Version: 2.6 | ||
specifiedRules, | ||
recommendedRules, | ||
// Individual validation rules. | ||
@@ -322,0 +323,0 @@ ExecutableDefinitionsRule, |
12
index.js
@@ -750,2 +750,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "recommendedRules", { | ||
enumerable: true, | ||
get: function get() { | ||
return _index5.recommendedRules; | ||
} | ||
}); | ||
Object.defineProperty(exports, "ExecutableDefinitionsRule", { | ||
@@ -907,2 +913,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(exports, "MaxIntrospectionDepthRule", { | ||
enumerable: true, | ||
get: function get() { | ||
return _index5.MaxIntrospectionDepthRule; | ||
} | ||
}); | ||
Object.defineProperty(exports, "LoneSchemaDefinitionRule", { | ||
@@ -909,0 +921,0 @@ enumerable: true, |
{ | ||
"name": "graphql", | ||
"version": "15.8.0", | ||
"version": "15.9.0", | ||
"description": "A Query Language and Runtime which can target any service.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,3 @@ export { validate } from './validate'; | ||
export { specifiedRules } from './specifiedRules'; | ||
export { specifiedRules, recommendedRules } from './specifiedRules'; | ||
@@ -8,0 +8,0 @@ // Spec Section: "Executable Definitions" |
@@ -24,2 +24,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "recommendedRules", { | ||
enumerable: true, | ||
get: function get() { | ||
return _specifiedRules.recommendedRules; | ||
} | ||
}); | ||
Object.defineProperty(exports, "ExecutableDefinitionsRule", { | ||
@@ -181,2 +187,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(exports, "MaxIntrospectionDepthRule", { | ||
enumerable: true, | ||
get: function get() { | ||
return _MaxIntrospectionDepthRule.MaxIntrospectionDepthRule; | ||
} | ||
}); | ||
Object.defineProperty(exports, "LoneSchemaDefinitionRule", { | ||
@@ -295,2 +307,4 @@ enumerable: true, | ||
var _MaxIntrospectionDepthRule = require("./rules/MaxIntrospectionDepthRule.js"); | ||
var _LoneSchemaDefinitionRule = require("./rules/LoneSchemaDefinitionRule.js"); | ||
@@ -297,0 +311,0 @@ |
@@ -183,2 +183,9 @@ "use strict"; | ||
for (var i = 0; i < fragmentNames2.length; i++) { | ||
var referencedFragmentName = fragmentNames2[i]; // Memoize so two fragments are not compared for conflicts more than once. | ||
if (comparedFragmentPairs.has(referencedFragmentName, fragmentName, areMutuallyExclusive)) { | ||
continue; | ||
} | ||
comparedFragmentPairs.add(referencedFragmentName, fragmentName, areMutuallyExclusive); | ||
collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentNames2[i]); | ||
@@ -185,0 +192,0 @@ } |
import { ValidationRule, SDLValidationRule } from './ValidationContext'; | ||
/** | ||
* Technically these aren't part of the spec but they are strongly encouraged | ||
* validation rules. | ||
*/ | ||
export const recommendedRules: ReadonlyArray<ValidationRule>; | ||
/** | ||
* This set includes all validation rules defined by the GraphQL spec. | ||
@@ -5,0 +11,0 @@ * |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.specifiedSDLRules = exports.specifiedRules = void 0; | ||
exports.specifiedSDLRules = exports.specifiedRules = exports.recommendedRules = void 0; | ||
@@ -61,2 +61,4 @@ var _ExecutableDefinitionsRule = require("./rules/ExecutableDefinitionsRule.js"); | ||
var _MaxIntrospectionDepthRule = require("./rules/MaxIntrospectionDepthRule.js"); | ||
var _LoneSchemaDefinitionRule = require("./rules/LoneSchemaDefinitionRule.js"); | ||
@@ -102,5 +104,11 @@ | ||
// Spec Section: "Input Object Field Uniqueness" | ||
// TODO: Spec Section | ||
// SDL-specific validation rules | ||
/** | ||
* Technically these aren't part of the spec but they are strongly encouraged | ||
* validation rules. | ||
*/ | ||
var recommendedRules = Object.freeze([_MaxIntrospectionDepthRule.MaxIntrospectionDepthRule]); | ||
/** | ||
* This set includes all validation rules defined by the GraphQL spec. | ||
@@ -111,3 +119,5 @@ * | ||
*/ | ||
var specifiedRules = Object.freeze([_ExecutableDefinitionsRule.ExecutableDefinitionsRule, _UniqueOperationNamesRule.UniqueOperationNamesRule, _LoneAnonymousOperationRule.LoneAnonymousOperationRule, _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule, _KnownTypeNamesRule.KnownTypeNamesRule, _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule, _VariablesAreInputTypesRule.VariablesAreInputTypesRule, _ScalarLeafsRule.ScalarLeafsRule, _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule, _UniqueFragmentNamesRule.UniqueFragmentNamesRule, _KnownFragmentNamesRule.KnownFragmentNamesRule, _NoUnusedFragmentsRule.NoUnusedFragmentsRule, _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule, _NoFragmentCyclesRule.NoFragmentCyclesRule, _UniqueVariableNamesRule.UniqueVariableNamesRule, _NoUndefinedVariablesRule.NoUndefinedVariablesRule, _NoUnusedVariablesRule.NoUnusedVariablesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _KnownArgumentNamesRule.KnownArgumentNamesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule, _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule, _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule]); | ||
exports.recommendedRules = recommendedRules; | ||
var specifiedRules = Object.freeze([_ExecutableDefinitionsRule.ExecutableDefinitionsRule, _UniqueOperationNamesRule.UniqueOperationNamesRule, _LoneAnonymousOperationRule.LoneAnonymousOperationRule, _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule, _KnownTypeNamesRule.KnownTypeNamesRule, _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule, _VariablesAreInputTypesRule.VariablesAreInputTypesRule, _ScalarLeafsRule.ScalarLeafsRule, _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule, _UniqueFragmentNamesRule.UniqueFragmentNamesRule, _KnownFragmentNamesRule.KnownFragmentNamesRule, _NoUnusedFragmentsRule.NoUnusedFragmentsRule, _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule, _NoFragmentCyclesRule.NoFragmentCyclesRule, _UniqueVariableNamesRule.UniqueVariableNamesRule, _NoUndefinedVariablesRule.NoUndefinedVariablesRule, _NoUnusedVariablesRule.NoUnusedVariablesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _KnownArgumentNamesRule.KnownArgumentNamesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule, _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule, _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule].concat(recommendedRules)); | ||
/** | ||
@@ -114,0 +124,0 @@ * @internal |
@@ -16,3 +16,3 @@ "use strict"; | ||
*/ | ||
var version = '15.8.0'; | ||
var version = '15.9.0'; | ||
/** | ||
@@ -25,3 +25,3 @@ * An object containing the components of the GraphQL.js version string | ||
major: 15, | ||
minor: 8, | ||
minor: 9, | ||
patch: 0, | ||
@@ -28,0 +28,0 @@ preReleaseTag: null |
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
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
2131544
539
38998