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

@escape.tech/graphql-armor-cost-limit

Package Overview
Dependencies
Maintainers
4
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@escape.tech/graphql-armor-cost-limit - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

2

dist/declarations/src/index.d.ts

@@ -10,2 +10,3 @@ import type { Plugin } from '@envelop/core';

ignoreIntrospection?: boolean;
fragmentRecursionCost?: number;
} & GraphQLArmorCallbackConfiguration;

@@ -16,2 +17,3 @@ declare class CostLimitVisitor {

private readonly config;
private readonly visitedFragments;
constructor(context: ValidationContext, options?: CostLimitOptions);

@@ -18,0 +20,0 @@ onOperationDefinitionEnter(operation: OperationDefinitionNode): void;

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

depthCostFactor: 1.5,
fragmentRecursionCost: 1000,
ignoreIntrospection: true,

@@ -42,2 +43,4 @@ onAccept: [],

_defineProperty(this, "visitedFragments", new Set());
this.context = context;

@@ -99,2 +102,7 @@ this.config = Object.assign({}, costLimitDefaultOptions, ...Object.entries(options !== null && options !== void 0 ? options : {}).map(([k, v]) => v === undefined ? {} : {

if (node.kind == graphql.Kind.FRAGMENT_SPREAD) {
if (this.visitedFragments.has(node.name.value)) {
return this.config.fragmentRecursionCost;
}
this.visitedFragments.add(node.name.value);
const fragment = this.context.getFragment(node.name.value);

@@ -101,0 +109,0 @@

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

depthCostFactor: 1.5,
fragmentRecursionCost: 1000,
ignoreIntrospection: true,

@@ -42,2 +43,4 @@ onAccept: [],

_defineProperty(this, "visitedFragments", new Set());
this.context = context;

@@ -99,2 +102,7 @@ this.config = Object.assign({}, costLimitDefaultOptions, ...Object.entries(options !== null && options !== void 0 ? options : {}).map(([k, v]) => v === undefined ? {} : {

if (node.kind == graphql.Kind.FRAGMENT_SPREAD) {
if (this.visitedFragments.has(node.name.value)) {
return this.config.fragmentRecursionCost;
}
this.visitedFragments.add(node.name.value);
const fragment = this.context.getFragment(node.name.value);

@@ -101,0 +109,0 @@

@@ -23,2 +23,3 @@ import { GraphQLError, Kind } from 'graphql';

depthCostFactor: 1.5,
fragmentRecursionCost: 1000,
ignoreIntrospection: true,

@@ -38,2 +39,4 @@ onAccept: [],

_defineProperty(this, "visitedFragments", new Set());
this.context = context;

@@ -95,2 +98,7 @@ this.config = Object.assign({}, costLimitDefaultOptions, ...Object.entries(options !== null && options !== void 0 ? options : {}).map(([k, v]) => v === undefined ? {} : {

if (node.kind == Kind.FRAGMENT_SPREAD) {
if (this.visitedFragments.has(node.name.value)) {
return this.config.fragmentRecursionCost;
}
this.visitedFragments.add(node.name.value);
const fragment = this.context.getFragment(node.name.value);

@@ -97,0 +105,0 @@

4

package.json
{
"name": "@escape.tech/graphql-armor-cost-limit",
"version": "1.7.0",
"version": "1.7.1",
"description": "Limit the cost of a GraphQL Query.",

@@ -39,4 +39,4 @@ "packageManager": "yarn@3.3.1",

"graphql": "16.6.0",
"typescript": "4.9.4"
"typescript": "4.9.5"
}
}
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