eslint-plugin-graphql
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -5,2 +5,6 @@ # Change log | ||
### v3.1.1 | ||
- Update the `required-fields` rule to handle inline fragments without field ancestors. [PR #240](https://github.com/apollographql/eslint-plugin-graphql/pull/240) by [Henry Q. Dineen](https://github.com/henryqdineen) | ||
### v3.1.0 | ||
@@ -7,0 +11,0 @@ |
@@ -72,7 +72,7 @@ "use strict"; | ||
var nearestField = void 0; | ||
var nearestFieldOrExecutableDefinition = void 0; | ||
var nextAncestor = void 0; | ||
// Now, walk up the ancestors, until you see a field. | ||
while (!nearestField) { | ||
// Now, walk up the ancestors, until you see a field or executable definition. | ||
while (!nearestFieldOrExecutableDefinition) { | ||
nextAncestor = ancestorClone.pop(); | ||
@@ -84,13 +84,13 @@ | ||
if (nextAncestor.kind === "Field") { | ||
nearestField = nextAncestor; | ||
if (nextAncestor.kind === "Field" || nextAncestor.kind === "FragmentDefinition" || nextAncestor.kind === "OperationDefiniton") { | ||
nearestFieldOrExecutableDefinition = nextAncestor; | ||
} | ||
} | ||
// If we never found a field, the query is malformed | ||
if (!nearestField) { | ||
throw new Error("Inline fragment found inside document without a parent field."); | ||
// If we never found a field or executable definition, the query is malformed | ||
if (!nearestFieldOrExecutableDefinition) { | ||
throw new Error("Inline fragment found inside document without a parent field, fragment definition, or operation definition."); | ||
} | ||
// We found a field, but we never saw the field we were looking for in | ||
// We found a field or executable definition, but we never saw the field we were looking for in | ||
// the intermediate selection sets. | ||
@@ -97,0 +97,0 @@ context.reportError(new _graphql.GraphQLError("'" + field + "' field required on '... on " + node.typeCondition.name.value + "'", [node])); |
{ | ||
"name": "eslint-plugin-graphql", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "GraphQL ESLint plugin.", | ||
@@ -5,0 +5,0 @@ "author": "Sashko Stubailo", |
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
102299