@apollo/server-plugin-landing-page-graphql-playground

中文文档
4.0.1发布于 2023/05/27MITTypeScriptESM + CJS近 30 天下载 402.3万

Apollo 服务器登陆页面插件

此软件包已被标记为弃用

The use of GraphQL Playground in Apollo Server was supported in previous versions, but this is no longer the case as of December 31, 2022. This package exists for v4 migration purposes only. We do not intend to resolve security issues or other bugs with this package if they arise, so please migrate away from this to [Apollo Server's default Explorer](https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages) as soon as possible.

中文使用文档

图QL 播放场插件

QQ 注: 阿波罗服务器中使用 GraphQL 播放地 上一个版本,但截至2022年12月31日,情况已不再如此. 此套件被贬值并仅用于v4迁移目的而存在. 我们不打算用这个软件包来解决安全问题或其他错误,所以请尽快从这里迁移到阿波罗服务器的默认探索器. ⚠️

这是阿波罗服务器 4 的插件, 它使您的 GraphQL 服务器服务 图QL 播放场 IDE 作为登陆页.

图QL Playground是阿波罗服务器2唯一可用的登陆页面. GraphQL 游戏场项目正式启动 退休人员 我们不建议继续使用它。 我们推荐阿波罗服务器4的默认登陆页面,该页面服务于类似但积极维护的 阿波罗沙盒,或自定义登陆页.

为了帮助从阿波罗服务器2迁移的开发者,我们仍然提供登陆页插件,允许您使用阿波罗服务器的GraphQL Playground. 在阿波罗服务器 3 中,该插件作为 apollo-server-core 软件包。 在阿波罗服务器4中,该插件在此包中单独分布.

要首先使用阿波罗服务器 4 的 GraphQL 游戏场 npm install @apollo/server-plugin-landing-page-graphql-playground,然后:

import { ApolloServer } from '@apollo/server';
import { ApolloServerPluginLandingPageGraphQLPlayground } from '@apollo/server-plugin-landing-page-graphql-playground';

const server = new ApolloServer({
  plugins: [ApolloServerPluginLandingPageGraphQLPlayground()],
  // ... other options ...
});

注意这将无条件为 GraphQL 游戏场服务 。 如果你喜欢只服务 在生产,你可以使用 process.env.NODE_ENV 来确定是否将插件包含在 plugins 选择自己.

版本与发布记录

@apollo/server-plugin-landing-page-graphql-playground 共发布 3 个版本,首次发布于 2022/08/16;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.0.1latest2023/05/273 年前
4.0.02022/10/114 年前
4.0.0-alpha.0alpha2022/08/164 年前

关于 @apollo/server-plugin-landing-page-graphql-playground 的常见问题

@apollo/server-plugin-landing-page-graphql-playground 是什么?

Apollo 服务器登陆页面插件注意:该包已被作者标记为弃用——The use of GraphQL Playground in Apollo Server was supported in previous versions, but this is no longer the case as of December 31, 2022. This package exists for v4 migration purposes only. We do not intend to resolve security issues or other bugs with this package if they arise, so please migrate away from this to [Apollo Server's default Explorer](https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages) as soon as possible.

如何安装 @apollo/server-plugin-landing-page-graphql-playground?

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

@apollo/server-plugin-landing-page-graphql-playground 支持 TypeScript 吗?

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

@apollo/server-plugin-landing-page-graphql-playground 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@apollo/server-plugin-landing-page-graphql-playground 需要什么版本的 Node.js?

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

@apollo/server-plugin-landing-page-graphql-playground 可以商用吗?

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

@apollo/server-plugin-landing-page-graphql-playground 的下载量有多少?

根据 npm 官方下载统计,@apollo/server-plugin-landing-page-graphql-playground 在 2026/10/07 – 2026/11/05 这 30 天内被下载 4,023,322 次,日均约 134,111 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apollo/server-plugin-landing-page-graphql-playground 还在维护吗?

最新版本 4.0.1 发布于 2023/05/27(3 年前);至今共发布 3 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/08/16。作者已将其标记为弃用,新项目建议寻找替代方案。