
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@bam.tech/koa-graphiql
Advanced tools
Koa middleware to display GraphiQL. Designed for Koa 2.
npm i --save koa-graphiql
Add it to your Koa app. You may want to use router middleware if your app serves more than GraphiQL.
import graphiql from 'koa-graphiql';
router.get('/graphiql', graphiql(async (ctx) => {
return {
// String of the base URL of the GraphQL endpoint
url: '/graphql',
// String to display in the query panel
query: 'query Demo($token: String) { viewer(token: $token) { id } }',
// Object used to populate the "variables" panel
variables: {
token: 'eyJhbGciOiJIUzI1NiJ9.YWNjb3VudFtpZGVd.-w3FiHaq5jIFIOzHErgdEQGvXXG6wClBUDFDVgwUyx8'
},
// Object to display in the result panel
result: {
data: {
viewer: { id: 'account[ide]' }
}
},
};
}));
Typically, you will want to populate the query
, variables
, and result
fields from data in the Koa context, such as the query parameters or request body. koa-graphiql
will do this for you by default.
FAQs
Koa middleware to display GraphiQL
The npm package @bam.tech/koa-graphiql receives a total of 4 weekly downloads. As such, @bam.tech/koa-graphiql popularity was classified as not popular.
We found that @bam.tech/koa-graphiql 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.