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

@escape.tech/graphql-armor-max-tokens

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@escape.tech/graphql-armor-max-tokens

Limit the number of tokens allowed in a GraphQL document.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
81K
increased by18.98%
Maintainers
4
Weekly downloads
 
Created
Source

@escape.tech/graphql-armor-max-tokens

This plugin will limit the number of tokens in a GraphQL operation.

Getting Started

# npm
npm install @escape.tech/graphql-armor-max-tokens

# yarn
yarn add @escape.tech/graphql-armor-max-tokens

Usage example

With @envelop/core from @the-guild-org

import { envelop } from '@envelop/core';
import { maxTokensPlugin } from '@escape.tech/graphql-armor-max-tokens';

const getEnveloped = envelop({
  plugins: [
    // ... other plugins ...
    maxTokensPlugin({
        maxTokenCount: 1000, // Number of tokens allowed in a document | Default: 1000
    }),
  ]
})

Design considerations

This plugin relies on a parser plugin to works and access query from the context.

This should be supported by the engine you use.

If you experience any issues, please open an issue.

FAQs

Package last updated on 08 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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