@apollographql/graphql-upload-8-fork

中文文档
8.1.4发布于 2022/10/21MITTypeScriptCommonJS近 30 天下载 61.4万

Fork of graphql-upload@8 that works with graphql@15 for compatibility with apollo-server@2

原始使用文档

This is a fork of graphql-upload by Jayden Seric which Apollo has created purely for the internal use of Apollo Server.

Apollo Server v2 depends on graphql-upload to provide an easy-to-use way to integrate graphql-upload into your servers without having to depend on graphql-upload yourself. It currently depends on v8 of graphql-upload.

graphql-upload made backwards-incompatible changes after v8, such as changing what Node versions are supported and removing the stream property that was later replaced with createReadStream. Because of this, we cannot upgrade the version of graphql-upload used by Apollo Server past v8 without potentially breaking users.

However, the latest release of graphql-upload@8 (8.1.0) declares peer dependencies on graphql that do not include graphql@15. We want users of Apollo Server v2 to be able to use graphql v15 without getting peer dependencies warnings (or errors when they are using npm v7), so we have forked graphql-upload v8 just to extend the peer dependency.

We do not recommend that you directly depend on this fork. Our recommendation is that if you want to use uploads in your GraphQL server, you should consider disabling Apollo Server's built-in graphql-upload integration by passing uploads: false to new ApolloServer and use graphql-upload directly. That way, you can use the latest and greatest version of graphql-upload. We currently intend to remove the integration from Apollo Server v3.

This fork also contains the TypeScript typings from DefinitelyTyped, so you don't have to try to combine this fork with @types/graphql-upload.

版本与发布记录

@apollographql/graphql-upload-8-fork 共发布 5 个版本,首次发布于 2021/02/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
8.1.4latest2022/10/214 年前
8.1.32021/02/125 年前
8.1.22021/02/125 年前
8.1.2-alpha.02021/02/125 年前
8.1.12021/02/125 年前

关于 @apollographql/graphql-upload-8-fork 的常见问题

@apollographql/graphql-upload-8-fork 是什么?

Fork of graphql-upload@8 that works with graphql@15 for compatibility with apollo-server@2

如何安装 @apollographql/graphql-upload-8-fork?

在项目目录运行 npm install @apollographql/graphql-upload-8-fork,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:graphql(0.13.1 - 15)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@apollographql/graphql-upload-8-fork 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@apollographql/graphql-upload-8-fork 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@apollographql/graphql-upload-8-fork 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=8.5。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@apollographql/graphql-upload-8-fork 可以商用吗?

@apollographql/graphql-upload-8-fork 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@apollographql/graphql-upload-8-fork 的下载量有多少?

根据 npm 官方下载统计,@apollographql/graphql-upload-8-fork 在 2026/10/07 – 2026/11/05 这 30 天内被下载 613,542 次,日均约 20,451 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apollographql/graphql-upload-8-fork 还在维护吗?

最新版本 8.1.4 发布于 2022/10/21(4 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/02/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。