Interface: UploadedFile
Defined in: packages/apollo/src/upload.ts:52
Represents an uploaded file in a GraphQL multipart request. Provides access to file metadata and streaming capabilities.
Example
typescript
const resolve = async (_, { file }: { file: Promise<UploadedFile> }) => {
const upload = await file;
const stream = upload.stream;
// Process stream...
};Methods
arrayBuffer()
ts
arrayBuffer(): Promise<ArrayBuffer>;Defined in: packages/apollo/src/upload.ts:66
Reads the entire file into an ArrayBuffer.
Returns
Promise<ArrayBuffer>
blob()
ts
blob(): Promise<Blob>;Defined in: packages/apollo/src/upload.ts:64
Returns the file as a Blob.
Returns
Promise<Blob>
text()
ts
text(): Promise<string>;Defined in: packages/apollo/src/upload.ts:68
Reads the entire file as UTF-8 text.
Returns
Promise<string>
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
fieldName | readonly | string | The form field name for this file upload. | packages/apollo/src/upload.ts:54 |
filename | readonly | string | The original filename provided by the client. | packages/apollo/src/upload.ts:56 |
mimetype | readonly | string | The MIME type of the file (e.g., 'image/jpeg', 'application/pdf'). | packages/apollo/src/upload.ts:58 |
size | readonly | number | The file size in bytes. | packages/apollo/src/upload.ts:60 |
stream | readonly | ReadableStream<Uint8Array<ArrayBufferLike>> | A readable stream of the file contents. Native Web Streams API. | packages/apollo/src/upload.ts:62 |