Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
apollo-link-batch-http
Advanced tools
An Apollo Link to allow batching of multiple operations into a single http request. Instead of sending a single operation, it sends an array of operations to the server.
npm install apollo-link-batch-http --save
To use this package in a web browser or mobile app, you'll need a build system capable of loading NPM packages on the client. Some common choices include Browserify, Webpack, and Meteor +1.3.
import BatchLink from "apollo-link-batch-http";
const link = new BatchLink({ uri: "/graphql" });
Batch HTTP Link takes an object with four options on it to customize the behavoir of the link.
name | value | default | required |
---|---|---|---|
uri | string | "/graphql" | false |
batchMax | number | 10 | false |
batchInterval | number | 10 | false |
fetch | ApolloFetch | ApolloFetch | false |
By default, this link uses the Apollo Fetch library for the HTTP transport.
The Batch HTTP Link uses the headers
field on the context to allow passing headers to the HTTP request.
name | value | default | required |
---|---|---|---|
headers | Headers (or object) | {} | false |
import BatchLink from "apollo-link-batch-http";
import ApolloClient from "apollo-client";
import InMemoryCache from "apollo-cache-inmemory";
const client = new ApolloClient({
link: new BatchLink({ uri: "/graphql" }),
cache: new InMemoryCache()
});
// a query with apollo-client that will be batched
client.query({
query: MY_QUERY,
context: {
// example of setting the headers with context per operation
headers: {
authoriztion: Meteor.userId()
}
}
})
FAQs
Batch HTTP transport layer for GraphQL
The npm package apollo-link-batch-http receives a total of 10,965 weekly downloads. As such, apollo-link-batch-http popularity was classified as popular.
We found that apollo-link-batch-http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.