Socket
Socket
Sign inDemoInstall

eslint-plugin-graphql

Package Overview
Dependencies
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-graphql - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

4

CHANGELOG.md

@@ -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 @@

18

lib/customGraphQLValidationRules.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc