Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@increments/graphql-client
Advanced tools
A lightweight GraphQL client which bundles sequence of queries into a single HTTP request.
If your project is using npm, you can install @increments/graphql-client package by npm command:
npm install --save @increments/graphql-client
# or
yarn add @increments/graphql-client
window.GraphQLClient
.Package | min.js.gz size |
---|---|
@increments/graphql-client | 800 B |
apollo-client (apollo-client-preset + graphql-tag + graphql) | 29 KB |
import { GraphQLClient } from "@increments/graphql-client"
const client = new GraphQLClient({
/** How long the client wait before invoking batch request in msec. */
wait: 50, // defualt value
/**
* Batch request handler.
*
* @param {string} query - Bundled GraphQL query string.
* @param {Object} variables - Bundled variables.
* @param {Function} resolve - Callback for successful response.
* @param {Function} reject - Callback for failure response.
*/
handle(query, variables, resolve, reject) {
// Send a HTTP request to your GraphQL server in your favorite way.
// Sample:
axios.post("/graphql", { query, variables })
.then(response => resolve(response.data)
.catch(reject)
}
})
// The handle function will be executed once, even though client.query is called twice.
Promise.all([
client.query("viewer { name }"),
client.query(`
repository(owner: $owner, name: $name) {
url
}`,
{
owner: {
type: "String!",
value: "increments",
},
name: {
type: "String!",
value: "graphql-client",
},
}
),
]).then((
viewer,
repository,
) => {
console.log(viewer.data.viewer.name)
console.log(repository.data.repository.url)
})
FAQs
A lightweight GraphQL client
We found that @increments/graphql-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.