
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
graphql-endpoint
Advanced tools
A lightweight framework for GraphQL endpoints.
Before (client):
fetch('somewhere/graphql', {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({ bigGraphQLQueryString, variables })
).then(response => response.json()) // receive GraphQLResult
After (client):
// put GraphQL variables into http GET queris
fetch('somewhere/wrapped/endpoint?variable1=abc&variable2=def')
.then(response => response.json()) // receive GraphQLResult
// or make GraphQL like POST without query
fetch('somehwere/wrapped/endpoint', {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({ variables }) // no need query, it's on server side
).then(response => response.json()) // receive GraphQLResult
Add graphql-endpoint
to your GraphQL server.
const { ApolloServer } = require('apollo-server-express')
const express = require('express')
const { GraphQLEndpoint } = require('graphql-endpoint')
const bodyParser = require('body-parser')
const app = express()
// graphql-endpoint requires json body to be parsed
app.use(bodyParser.json())
// Adopt graphql-endpoint
GraphQLEndpoint(app)
const server = new ApolloServer(configs)
server.applyMiddleware({
app,
bodyParser: false // optional disable bodyParser, we already have it
})
Then put your GraphQL query files into src/endpoints/
. For example, the src/endpoints/my_api
with content { example(id: 123) { title, description } }
will serve GraphQL result on /my_api
.
The wrapped API endpoint will support two types of http requests:
FAQs
A lightweight framework for GraphQL endpoints
The npm package graphql-endpoint receives a total of 4 weekly downloads. As such, graphql-endpoint popularity was classified as not popular.
We found that graphql-endpoint 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.