Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@envelop/validation-cache
Advanced tools
This plugins adds simple LRU caching to your `validate`, to improve performance by caching the validation result.
@envelop/validation-cache is a plugin for GraphQL that provides caching for validation results. This can significantly improve the performance of GraphQL servers by avoiding redundant validation of the same queries.
Validation Caching
This feature allows you to cache the results of GraphQL query validations. By using the `useValidationCache` plugin, you can avoid re-validating the same queries, thus improving performance.
const { envelop } = require('@envelop/core');
const { useValidationCache } = require('@envelop/validation-cache');
const getEnveloped = envelop({
plugins: [
useValidationCache(),
],
});
graphql-query-complexity is a package that helps in limiting the complexity of GraphQL queries to prevent abuse. While it doesn't cache validation results, it provides a way to control the resource usage of queries, which can complement the functionality of @envelop/validation-cache.
graphql-cost-analysis is another package that helps in analyzing and limiting the cost of GraphQL queries. It focuses on preventing expensive queries from being executed, which can be used alongside @envelop/validation-cache to ensure both performance and security.
graphql-depth-limit is a package that restricts the depth of GraphQL queries to prevent overly complex queries. This can be used in conjunction with @envelop/validation-cache to ensure that only queries of acceptable complexity are cached and executed.
@envelop/validation-cache
This plugins adds simple LRU caching to your validate
, to improve performance by caching the validation result.
This plugins improves performance of validating by ~50% (based on benchmarks).
yarn add @envelop/validation-cache
import { envelop } from '@envelop/core';
import { useValidationCache } from '@envelop/validation-cache';
const getEnveloped = envelop({
plugins: [
// ... other plugins ...
useValidationCache({
// options goes here
}),
],
});
cache
Set this to pass in a cache instance. By default a new LRU cache is created using default max
and ttl
.
FAQs
This plugins adds simple LRU caching to your `validate`, to improve performance by caching the validation result.
The npm package @envelop/validation-cache receives a total of 100,005 weekly downloads. As such, @envelop/validation-cache popularity was classified as popular.
We found that @envelop/validation-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.