Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Effortlessly craft GraphQL APIs on the Edge, designed to thrive across various JavaScript runtimes.
Effortlessly craft GraphQL APIs on the Edge, designed to thrive across various JavaScript runtimes.
Runtime | Status | Example |
---|---|---|
Cloudflare Workers | :white_check_mark: | cloudflare |
Node | :white_check_mark: | node |
Bun | :white_check_mark: | Bun |
Deno | :white_large_square: Pending | |
Vercel | :white_large_square: Pending |
import { NodeEdgeQL } from 'edgeql/node'
const app = new NodeEdgeQL()
app.handle(`
type Query {
hello: String
}
`, (ctx) => {
return `hello from EdgeQL on ${ctx.runtime.runtime}`
})
app.listen({port: 4000}, ({address, family, port}) => {
console.log(address, family, port)
})
import { EdgeQL } from 'edgeql'
import type { Context } from 'edgeql'
const app = new EdgeQL()
app.handle(`
type Query {
hello: String
}
`, (_ctx: Context) => {
return 'hello from EdgeQL on Bun'
})
const port = Bun.env['PORT'] ? parseInt(Bun.env['PORT']) : 3000
console.log(`Running at http://localhost:${port}`)
export default {
port,
fetch: app.fetch
}
import { EdgeQL } from 'edgeql'
import type { Context } from 'edgeql'
const app = new EdgeQL()
app.handle(
`
type Query {
whereami: String
}
`,
(ctx: Context) => {
return `EdgeQL is running on ${ctx.runtime.runtime}`
})
EdgeQL supports both Schema-First and Code-First.
import { EdgeQL } from 'edgeql'
const app = new EdgeQL()
const schema = `
type Query {
hello: String
}
`
app.handle(schema, (ctx: Context) => 'world')
export default app
import { EdgeQL } from 'edgeql'
import type { Context } from 'edgeql'
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
} from 'graphql'
const app = new EdgeQL()
const helloworld: GraphQLSchema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: {
helloworld: {
type: GraphQLString,
resolve: (parent: any, args: any, ctx: Context, info: any) => {
return 'helloworld, EdgeQL'
},
},
},
})
})
app.handle(helloworld)
export default app
EdgeQL adopts the same middleware style like Koa, middleware are simple functions which return a MiddlewareFunction
with signature (ctx, next). When the middleware is run, it must manually invoke next()
to run the "downstream" middleware.
For example if you wanted to track how long it takes for a request to propagate through EdgeQL by adding an X-Response-Time
header field the middleware would look like the following:
async function responseTime(ctx: Context, next: Next) {
const start = Date.now();
await next();
const ms = Date.now() - start;
ctx.set('X-Response-Time', `${ms}ms`);
}
app.use(responseTime);
The builtin middlewares are,
FAQs
Effortlessly craft GraphQL APIs on the Edge, designed to thrive across various JavaScript runtimes.
The npm package edgeql receives a total of 18 weekly downloads. As such, edgeql popularity was classified as not popular.
We found that edgeql demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.