gr2m / gr2m/github-project

New custom field not accessible

未关闭
#151 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
JavaScript
星标
36
派生
10
PR 合并指标
30 天内没有已合并 PR

描述

### Please avoid duplicates

- [X] I checked [all open bugs](https://github.com/gr2m/github-project/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and none of them matched my problem.

### Reproducible test case

_No response_

### Please select the environment(s) that are relevant to your bug report

- [ ] Browsers
- [X] Node
- [ ] Deno

### Versions

NodeJs: v18.18.2
github-project: 5.4.0

### What happened?

I have a weird issue: Some of the newly created custom fields cannot be found. I created different fields with different types but nothing works. Interestingly old custom fields that I created a while back work fine.

```
const options = {
owner: "xxx",
number: 2,
token: "xxx",
fields: {
priority: "Priority",
milestone: "Milestone",
Estimate: { name: "Estimate", optional: true },
lastUpdate: { name: "Last Update", optional: true },
},
};
const project = new GitHubProject(options);
const data = await project.items.list();
console.log(data[0]);
```

results in getting the right object, but the `Estimate` custom field is missing.

Running this:

```
const data = await octokit.graphql(`
query {
node(id: "PVT_kwDOAYW1RM4AAzYZ") {
... on ProjectV2 {
items(first: 20) {
nodes {
id
fieldValues(first: 20) {
nodes {
... on ProjectV2ItemFieldNumberValue {
field {
... on ProjectV2Field {
name
}
}
number
id
updatedAt
creator {
url
}
}
}
}
}
}
}
}
}
`);

console.log(data.node.items.nodes[0].fieldValues.nodes);
```

results in

```
[
{},
{},
{},
{},
{},
{},
{},
{},
{
field: { name: 'Estimate' },
number: 15,
id: 'PVTFNV_lQDOAYW1RM4AAzYczgJ_92DOB0nF8A',
updatedAt: '2023-11-05T00:20:25Z',
creator: { url: 'https://github.com/bobinrinder' }
},
{}
]
```

So looks like the name is set correctly. Any ideas? 🧐

### Would you be interested in contributing a fix?

- [x] yes

贡献指南

打开贡献指南

调研方向

首先运行 Node 示例,并将 items.list() 与原始的 GitHub GraphQL fieldValues 响应进行比较。跟踪 items.list() 的入口点和自定义字段解析路径;当新创建的字段(例如 Estimate)能够与 GraphQL 数据一致地返回时,即表示完成。

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

评估

技术栈
github, graphql, javascript, node.js
领域
api, backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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