Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
apollo-link-optimistic
Advanced tools
An Apollo link that immediately returns an optimistic response before returning the server response
An Apollo Link that immediately returns an optimistic response provided in the context of the request, before returning the server response(s).
npm install apollo-link-optimistic
or
yarn add apollo-link-optimsitic
import { ApolloLink } from 'apollo-link';
import { HttpLink } from 'apollo-link-http';
import { RetryLink } from 'apollo-link-retry';
import gql from 'graphql-tag';
import OptimisticLink from 'apollo-link-optimistic';
this.link = ApolloLink.from([
new OptimisticLink(),
new HttpLink({ uri: URI_TO_YOUR_GRAPHQL_SERVER }),
]);
const optimisticResponse = {
data: {
hello: 'Optimistic World',
},
};
const op = {
query: gql`{ hello }`,
context: {
// OptimisticLink gets the optimistic response from the context.
optimisticResponse,
},
};
link.execute(op).subscribe({
next(response) { console.log(response.data.hello); },
complete() { console.log('complete!'); },
});
// Assuming the server responds with { data: { hello: "Server World" } }
// This code will output:
// "Optimistic World"
// "Server World"
// "complete!"
FAQs
An Apollo link that immediately returns an optimistic response before returning the server response
The npm package apollo-link-optimistic receives a total of 5 weekly downloads. As such, apollo-link-optimistic popularity was classified as not popular.
We found that apollo-link-optimistic 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.