@plasius/graph-runtime-azure-functions
v0.1.2
Published
Azure Functions runtime adapter for graph gateway read/write endpoints
Maintainers
Readme
@plasius/graph-runtime-azure-functions
Azure Functions runtime adapter for graph read and write HTTP handlers.
Apache-2.0. ESM + CJS builds. TypeScript types included.
Requirements
- Node.js 24+ (matches
.nvmrcand CI/CD) @azure/functions4.x (peerDependencies)@plasius/graph-gateway-core@plasius/graph-write-coordinator
Installation
npm install @plasius/graph-runtime-azure-functions @azure/functionsExports
import {
createGraphReadHandler,
createGraphWriteHandler,
type GraphReadHandlerOptions,
type GraphWriteHandlerOptions,
} from "@plasius/graph-runtime-azure-functions";Quick Start
import { app } from "@azure/functions";
import {
createGraphReadHandler,
createGraphWriteHandler,
} from "@plasius/graph-runtime-azure-functions";
app.http("graph-read", {
methods: ["POST"],
authLevel: "function",
handler: createGraphReadHandler({ gateway, telemetry }),
});
app.http("graph-write", {
methods: ["POST"],
authLevel: "function",
handler: createGraphWriteHandler({ coordinator, telemetry }),
});Security and Input Validation
Handler factories enforce boundary validation for external input:
- Read payloads must satisfy
isGraphQuery. - Write payloads must satisfy strict write-command shape rules (idempotency/partition/aggregate keys + payload + timestamp).
- Optional payload size guard via
maxBodyBytes(default64KB, returns413when exceeded). - Optional authorization guard via
authorize(context)(returns403when denied).
Failure responses are bounded and sanitized:
- Read validation/auth/body-limit:
400/403/413 - Read upstream execution failure:
502 - Write validation/auth/body-limit:
400/403/413 - Write upstream execution failure:
503
Development
npm run clean
npm install
npm run lint
npm run typecheck
npm run test:coverage
npm run buildTelemetry
Both handlers accept optional telemetry (TelemetrySink) and emit:
- Read:
graph.runtime.read.request,graph.runtime.read.latency,graph.runtime.read.error - Write:
graph.runtime.write.request,graph.runtime.write.latency,graph.runtime.write.error
Architecture
- Package ADRs:
docs/adrs - Cross-package ADRs:
plasius-ltd-site/docs/adrs/adr-0020toadr-0024
License
Licensed under the Apache-2.0 License.
