Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@urql/exchange-request-policy
Advanced tools
An exchange for operation request-policy upgrading in urql
@urql/exchange-request-policy
is an exchange for the urql
GraphQL client that will automatically upgrade operation request-policies
on a time-to-live basis.
First install @urql/exchange-request-policy
alongside urql
:
yarn add @urql/exchange-request-policy
# or
npm install --save @urql/exchange-request-policy
Then add it to your client.
import { createClient, cacheExchange, fetchExchange } from 'urql';
import { requestPolicyExchange } from '@urql/exchange-request-policy';
const client = createClient({
url: 'http://localhost:1234/graphql',
exchanges: [
requestPolicyExchange({
// The amount of time in ms that has to go by before upgrading, default is 5 minutes.
ttl: 60 * 1000, // 1 minute.
// An optional function that allows you to specify whether an operation should be upgraded.
shouldUpgrade: operation => operation.context.requestPolicy !== 'cache-only',
}),
cacheExchange,
fetchExchange,
],
});
Now when the exchange sees a cache-first
operation that hasn't been seen in ttl amount of time it will upgrade
the requestPolicy
to cache-and-network
.
FAQs
An exchange for operation request-policy upgrading in urql
The npm package @urql/exchange-request-policy receives a total of 11,877 weekly downloads. As such, @urql/exchange-request-policy popularity was classified as popular.
We found that @urql/exchange-request-policy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.