将 graphql-yoga 从 5.x 升级到 6.x
根据 TypeScript 类型自动比较 graphql-yoga 5.24.6 与 6.0.0 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 6 |
| 已修改的签名 | 3 |
| 已删除的类或接口成员 | 2 |
| 已修改的类或接口成员 | 2 |
| 新增弃用 | 0 |
| 要求变化(engines、peer 依赖) | 2 |
| 新增导出 | 16 |
已删除的导出
| import | export | kind | 之前 |
|---|---|---|---|
graphql-yoga | isPromise | variable | any |
graphql-yoga | mergeSchemas | variable | any |
graphql-yoga | mapMaybePromise | variable | any |
graphql-yoga | mapAsyncIterator | variable | any |
graphql-yoga | DisposableSymbols | variable | any |
graphql-yoga | createGraphQLError | variable | any |
已修改的签名
| export | 之前 | 之后 |
|---|---|---|
graphql-yoga · MaskError | (error: unknown, message: string, isDev?: boolean | undefined) => Error | (error: unknown, message: string, isDev?: boolean | undefined, context?: (Partial<YogaInitialContext> & YogaConfigContext) | undefined) => Error |
graphql-yoga · maskError | (error: unknown, message: string, isDev?: boolean | undefined): Error | (error: unknown, message: string, isDev?: boolean | undefined, context?: (Partial<YogaInitialContext> & YogaConfigContext) | undefined): Error |
graphql-yoga · YogaServerOptions | Omit<ServerAdapterOptions<TServerContext>, "plugins"> & { logging?: any; maskedErrors?: boolean | Partial<YogaMaskedErrorOpts> | undefined; context?: TUserContext | ((initialContext: YogaInitialContext & TServerContext) => TUserContext | Promise<TUserContext>) | Promise<TUserContext> | undefined; cors?: any; graphqlEndpoint?: string | undefined; healthCheckEndpoint?: string | undefined; landingPage?: boolean | LandingPageRenderer | undefined; graphiql?: GraphiQLOptionsOrFactory<TServerContext> | undefined; renderGraphiQL?: ((options: GraphiQLOptions) => PromiseOrValue<BodyInit>) | undefined; s… | Omit<ServerAdapterOptions<TServerContext>, "plugins"> & { logging?: any; requestId?: boolean | RequestIdOptions<TServerContext> | undefined; maskedErrors?: boolean | Partial<YogaMaskedErrorOpts> | undefined; context?: TUserContext | ((initialContext: YogaInitialContext & TServerContext) => TUserContext | Promise<TUserContext>) | Promise<TUserContext> | undefined; cors?: any; graphqlEndpoint?: string | undefined; healthCheckEndpoint?: string | undefined; landingPage?: boolean | LandingPageRenderer | undefined; graphiql?: GraphiQLOptionsOrFactory<TServerContext> | undefined; renderGraphiQL?: ((o… |
已删除的类或接口成员
| member | import | 之前 |
|---|---|---|
YogaServer.logger | graphql-yoga | YogaLogger |
GraphiQLPluginConfig.logger | graphql-yoga | any |
已修改的类或接口成员
| member | 之前 | 之后 |
|---|---|---|
YogaServer.parseRequest | (request: Request, serverContext: any): MaybePromise<{ requestParserResult: GraphQLParams<Record<string, any>, Record<string, any>> | GraphQLParams<Record<string, any>, Record<string, any>>[]; response?: undefined; } | { requestParserResult?: undefined; response: Response; }> | (request: Request, serverContext: any, fetchAPI?: any): MaybePromise<{ requestParserResult: GraphQLParams<Record<string, any>, Record<string, any>> | GraphQLParams<Record<string, any>, Record<string, any>>[]; response?: undefined; } | { requestParserResult?: undefined; response: Response; }> |
YogaServer.getResultForParams | ({ params, request, }: { params: GraphQLParams<Record<string, any>, Record<string, any>>; request: Request; }, context: TServerContext): PromiseOrValue<any> | ({ params, request, }: { params: GraphQLParams<Record<string, any>, Record<string, any>>; request: Request; }, context: TServerContext, fetchAPI?: any): PromiseOrValue<any> |
新增弃用
未发现。
要求变化(engines、peer 依赖)
| 之前 | 之后 | |
|---|---|---|
engines.node | >=18.0.0 | >=22.15.0 |
peerDependencies.graphql | ^15.2.0 || ^16.0.0 || ^17.0.0 | ^16.0.0 || ^17.0.0 |
新增导出 (16)
| import | export | kind |
|---|---|---|
graphql-yoga | Logger | variable |
graphql-yoga | LogLevel | variable |
graphql-yoga | LegacyLogger | variable |
graphql-yoga | getRequestId | function |
graphql-yoga | useRequestId | function |
graphql-yoga | MemoryLogWriter | variable |
graphql-yoga | RequestIdOptions | interface |
graphql-yoga | YogaConfigContext | type |
graphql-yoga | GenerateRequestIdFn | type |
graphql-yoga | withSchemaCoordinate | function |
graphql-yoga | defaultRequestIdHeader | variable |
graphql-yoga | createLoggerFromLogging | function |
graphql-yoga | GenerateRequestIdPayload | interface |
graphql-yoga | defaultGenerateRequestId | variable |
graphql-yoga | useConfigInServerContext | function |
graphql-yoga | ConfigInServerContextOptions | interface |
把这些数据交给你的 AI 智能体
Vigia 是免费的 MCP 服务器:你的编程智能体在写代码之前就能检查版本、不兼容变更和安全漏洞。无需注册,无需 API 密钥。
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
添加到 Cursor添加到 VS Code★ 在 GitHub 上加星
任何其他 MCP 客户端
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }常见问题
将 graphql-yoga 从 5 升级到 6 有哪些不兼容变更?
在 graphql-yoga 5.24.6 与 6.0.0 之间,Vigia 发现 6 个已删除的导出、3 个已修改的签名,以及 4 个已删除或修改的类或接口成员。
graphql-yoga 6 中弃用了哪些内容?
graphql-yoga 6.0.0 中有 0 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/graphql-yoga/upgrade?from=5.24.6&to=6.0.0