flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullable

未关闭 适合新手
#2,139 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
graphql, typescript
领域
api, backend

调研方向

从 flash.resolver.ts 开始,查看 FlashResolver.flash() 不再返回 guid 的地方,并与 flash.model.ts 中声明的非空 Flash.guid 进行比较。检查 vars { flashGuid } 如何获取 emhttp.var.flashGuid。完成的标准是:flash { guid } 返回启动 GUID,或者将该字段改为可空以适配没有 GUID 的服务器,并且查询不再将整个响应置为空。由于 issue 对此未作定论,请先在两种修复方案之间做出决定。

由索引模型根据 Issue 内容生成。

描述

Environment

Unraid OS Version: 7.3.4 (API 4.37.9+bedd403a)

Are you using a reverse proxy? No. Tested directly against the server's built-in /graphql endpoint, authenticated with an x-api-key (ADMIN role).

Hardware / setup that may matter: Supermicro X12STH-F, Xeon E-2356G. Boots from a USB flash drive with a Pro licence registered to it (not internal boot, not TPM licensing). vars { flashGuid } returns the correct GUID on this server, so the value is available to the API.

Pre-submission Checklist

  • I have verified that my Unraid OS is up to date
  • I have tested this issue by accessing my server directly (not through a reverse proxy)
  • This is not an Unraid Connect related issue (if it is, please submit via the support form instead)

Issue Description

Any flash query that asks for guid fails, because the resolver never returns it and the schema says it can never be null.

Flash.guid is declared as String! in flash.model.ts, but FlashResolver.flash() returns only id, vendor and product. guid: emhttp.var.flashGuid was removed from the resolver in #1361 (commit 586653cc, 2025-04-29) and the field was never removed from the model. It is still like this on main.

Steps to Reproduce

  1. query { flash { id vendor product } } succeeds.
  2. query { flash { guid } } fails.

Expected Behavior

guid returns the boot device GUID (the same value as vars { flashGuid }), or the field is nullable or removed if it is meant to go away for internal boot / TPM servers.

Actual Behavior

{"errors":[{"message":"Cannot return null for non-nullable field Flash.guid.","path":["flash","guid"]}],"data":null}

Because flash itself is non-nullable on Query, the error also wipes out every other field in the same request: { online flash { guid } } returns "data": null.

Additional Context

Possible fixes: put back guid: emhttp.var.flashGuid in flash.resolver.ts, or make the field nullable: true if internal boot servers have no flash GUID (see #1880). The workaround for now is vars { flashGuid }.

主要语言
TypeScript
星标
123
派生
25
平均合并
2 天 16 小时
30 天内合并 PR
9

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

unraid/api 的其他 Issue

查看 unraid/api 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。