qmetrics.net

GraphQL Upload

GraphQL multipart file upload middleware for Node.js servers

GraphQL Upload screenshot

graphql-upload adds an Upload scalar and middleware so Node.js GraphQL servers accept multipart requests. Clients send files as mutation or query variables per the multipart request spec.

Overview

graphql-upload is a Node.js library that implements file uploads for GraphQL servers following the GraphQL multipart request specification. It supplies middleware for common HTTP frameworks and an Upload scalar for schema authors.

Clients map uploaded files to GraphQL variables; resolvers receive promises that resolve to file metadata and streams for storage or processing. Middleware parses multipart bodies, wires Upload placeholders into operations, and passes executed queries to the GraphQL layer. Express and Koa integrations are provided, and a lower-level processRequest helper supports custom stacks.

The design handles deduplicated files, multiple variables referencing one upload, and concurrent resolver access through filesystem buffering. Uploaded streams are coordinated so resolvers can read independent streams from buffered content until the response completes.

The package ships as ES modules with deep imports for the scalar, middleware, and request processor. It expects a peer dependency on graphql and is commonly composed with schema tools that declare the Upload scalar in SDL.

Key features

  • Upload scalar for GraphQL schemas
  • Express and Koa middleware
  • Multipart request spec support
  • Custom middleware via processRequest
  • Stream-based resolver file access
  • Concurrent upload stream coordination
  • ES module deep imports
  • graphql peer dependency

Use cases

  • File uploads through GraphQL mutations
  • Node.js GraphQL server multipart support
  • Express or Koa GraphQL APIs with files
  • Cloud or filesystem upload pipelines
  • Custom GraphQL HTTP middleware stacks

Tags

Similar software

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

OkHttp

HTTP client for JVM, Android, and GraalVM

OkHttp is an HTTP client library tuned for efficient networking on Android, Java, and GraalVM native images. It offers synchronous and asynchronous call APIs with a fluent request builder.

★ 47.1k⟳ yesterdayApache-2.0
Frameworks & PlatformsDesktop/CLI app

gRPC

Cross-language remote procedure call framework

gRPC is an RPC framework that lets client and server programs communicate transparently and supports building connected, multi-language systems.

★ 45.5k⟳ todayApache-2.0

tRPC

End-to-end typesafe TypeScript APIs without code generation

tRPC helps teams define server procedures and call them from clients with full TypeScript types for inputs, outputs, and errors—no schemas or codegen step.

★ 40.9k⟳ todayMIT
Frameworks & PlatformsDesktop/CLI app

go-zero

Cloud-native Go microservices and RPC framework

go-zero is a Go web and RPC framework with code generation, built-in resilience middleware, and tooling aimed at stable high-traffic services.

★ 33.5k⟳ 9 days agoMIT