UNPKG

@profusion/apollo-federation-upload

Version:

This library makes it easier to support file uploads to your federated micro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution. It works by simply redirecting the file uploaded stream to

19 lines (18 loc) 959 B
import { type GraphQLDataSourceProcessOptions, RemoteGraphQLDataSource } from '@apollo/gateway'; import type { FetchInterface, FetchOptions } from 'make-fetch-happen'; declare type ConstructorArgs = Exclude<ConstructorParameters<typeof RemoteGraphQLDataSource>[0], undefined>; declare type Response = Awaited<ReturnType<FetchInterface>>; declare type ProcessResult = ReturnType<RemoteGraphQLDataSource['process']>; export declare type FileUploadDataSourceArgs = Omit<ConstructorArgs, 'fetcher'> & { useChunkedTransfer?: boolean; }; export default class FileUploadDataSource extends RemoteGraphQLDataSource { fetcher: FetchInterface; private static extractFileVariables; private addDataHandler; constructor(config?: FileUploadDataSourceArgs); process(args: GraphQLDataSourceProcessOptions): ProcessResult; private processFiles; didEncounterError(error: unknown, _request: FetchOptions, _reponse?: Response): never; } export {};