Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
graphql-client
Advanced tools
Small http client based on the fetch api. Uses isomorphic-fetch for wider support
Small http client based on the fetch api. Uses isomorphic-fetch for wider support
If query fails, errors are thrown with messages and query highlight for easy debug
npm install graphql-client -S
Initialize the client
var client = require('graphql-client')({
url: 'http://your-host/graphql',
headers: {
Authorization: 'Bearer ' + token
}
})
Use the promise API
WARNING: Make sure the Promise API is polyfilled for older browsers, you can use es6-promise
var variables = {
query: "Search Query",
limit: 100,
from: 200
}
client.query(`
query search ($query: String, $from: Int, $limit: Int) {
search(query: $query, from: $from, limit: $limit) {
took,
totalHits,
hits {
name
}
}
}`, variables, function(req, res) {
if(res.status === 401) {
throw new Error('Not authorized')
}
})
.then(function(body) {
console.log(body)
})
.catch(function(err) {
console.log(err.message)
})
FAQs
Small http client based on the fetch api. Uses isomorphic-fetch for wider support
The npm package graphql-client receives a total of 3,804 weekly downloads. As such, graphql-client popularity was classified as popular.
We found that graphql-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.