Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-query-complexity

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-query-complexity - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

21

dist/QueryComplexity.js

@@ -46,3 +46,2 @@ 'use strict';

this.options = options;
this.fragments = this.getFragments(context);

@@ -56,13 +55,2 @@ this.OperationDefinition = {

(0, _createClass3.default)(QueryComplexity, [{
key: 'getFragments',
value: function getFragments(context) {
return context.getDocument().definitions.reduce(function (map, definition) {
if (definition.kind === _graphql.Kind.FRAGMENT_DEFINITION) {
map[definition.name.value] = definition;
}
return map;
}, {});
}
}, {
key: 'onOperationDefinitionEnter',

@@ -121,3 +109,8 @@ value: function onOperationDefinitionEnter(operation) {

// Get arguments
var args = (0, _values.getArgumentValues)(field, childNode, _this.options.variables || {});
var args = void 0;
try {
args = (0, _values.getArgumentValues)(field, childNode, _this.options.variables || {});
} catch (e) {
return _this.context.reportError(e);
}

@@ -147,3 +140,3 @@ // Check if we have child complexity

{
var fragment = _this.fragments[childNode.name.value];
var fragment = _this.context.getFragment(childNode.name.value);
var fragmentType = _this.context.getSchema().getType(fragment.typeCondition.name.value);

@@ -150,0 +143,0 @@ nodeComplexity = _this.nodeComplexity(fragment, fragmentType);

{
"name": "graphql-query-complexity",
"version": "0.1.1",
"version": "0.1.2",
"description": "Validation rule for GraphQL query complexity analysis",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

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