@escape.tech/graphql-armor-max-tokens
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -6,3 +6,2 @@ 'use strict'; | ||
var graphql = require('graphql'); | ||
var error = require('graphql/error'); | ||
var parser = require('graphql/language/parser'); | ||
@@ -68,3 +67,3 @@ | ||
if (this._tokenCount > this.config.n) { | ||
const err = error.syntaxError(this._lexer.source, token.start, `Token limit of ${this.config.n} exceeded.`); | ||
const err = new graphql.GraphQLError(`Syntax Error: Token limit of ${this.config.n} exceeded.`); | ||
for (const handler of this.config.onReject) { | ||
@@ -71,0 +70,0 @@ handler(null, err); |
@@ -6,3 +6,2 @@ 'use strict'; | ||
var graphql = require('graphql'); | ||
var error = require('graphql/error'); | ||
var parser = require('graphql/language/parser'); | ||
@@ -68,3 +67,3 @@ | ||
if (this._tokenCount > this.config.n) { | ||
const err = error.syntaxError(this._lexer.source, token.start, `Token limit of ${this.config.n} exceeded.`); | ||
const err = new graphql.GraphQLError(`Syntax Error: Token limit of ${this.config.n} exceeded.`); | ||
for (const handler of this.config.onReject) { | ||
@@ -71,0 +70,0 @@ handler(null, err); |
@@ -1,3 +0,2 @@ | ||
import { TokenKind } from 'graphql'; | ||
import { syntaxError } from 'graphql/error'; | ||
import { TokenKind, GraphQLError } from 'graphql'; | ||
import { Parser } from 'graphql/language/parser'; | ||
@@ -63,3 +62,3 @@ | ||
if (this._tokenCount > this.config.n) { | ||
const err = syntaxError(this._lexer.source, token.start, `Token limit of ${this.config.n} exceeded.`); | ||
const err = new GraphQLError(`Syntax Error: Token limit of ${this.config.n} exceeded.`); | ||
for (const handler of this.config.onReject) { | ||
@@ -66,0 +65,0 @@ handler(null, err); |
{ | ||
"name": "@escape.tech/graphql-armor-max-tokens", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Limit the number of tokens allowed in a GraphQL document.", | ||
"packageManager": "yarn@3.6.0", | ||
"packageManager": "yarn@4.0.2", | ||
"main": "dist/graphql-armor-max-tokens.cjs.js", | ||
@@ -33,13 +33,13 @@ "module": "dist/graphql-armor-max-tokens.esm.js", | ||
"optionalDependencies": { | ||
"@envelop/core": "^4.0.0", | ||
"@envelop/core": "^5.0.0", | ||
"@escape.tech/graphql-armor-types": "0.5.0" | ||
}, | ||
"devDependencies": { | ||
"@envelop/core": "4.0.0", | ||
"@envelop/testing": "6.0.0", | ||
"@envelop/types": "4.0.0", | ||
"@envelop/core": "5.0.0", | ||
"@envelop/testing": "7.0.0", | ||
"@envelop/types": "5.0.0", | ||
"@escape.tech/graphql-armor-types": "0.5.0", | ||
"graphql": "16.7.1", | ||
"typescript": "5.1.3" | ||
"graphql": "16.8.1", | ||
"typescript": "5.3.3" | ||
} | ||
} |
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
12082
314