如何使用GraphQL在GitHub上查询项目注释?

huangapple go评论84阅读模式
英文:

How to query project notes on Github using GraphQL?

问题

I found a project at the address https://github.com/delbaoliveira/website/projects/1. I am using the GitHub GraphQL API to retrieve the desired notes.

I also created a similar project, but the returned result is undefined. I suspect that the variable columnId is incorrect.

So, how can I obtain the columnId? Please help me!

英文:

I found a project at the address https://github.com/delbaoliveira/website/projects/1. I am using the GitHub GraphQL API to retrieve the desired notes.
如何使用GraphQL在GitHub上查询项目注释?
I also created a similar project, but the returned result is undefined. I suspect that the variable columnId is incorrect.

如何使用GraphQL在GitHub上查询项目注释?

So, how can I obtain the columnId? Please help me!

答案1

得分: 0

你可以使用以下查询获取columnId

  1. query {
  2. repository(name: "website", owner: "delbaoliveira") {
  3. project(number: 1) {
  4. name
  5. columns(first: 1) {
  6. nodes {
  7. id
  8. name
  9. }
  10. }
  11. }
  12. }
  13. }

但你也可以在没有columnId的情况下获取列数据,像这样:

  1. query {
  2. repository(name: "website", owner: "delbaoliveira") {
  3. project(number: 1) {
  4. name
  5. columns(first: 1) {
  6. nodes {
  7. name
  8. cards {
  9. nodes {
  10. note
  11. }
  12. }
  13. }
  14. }
  15. }
  16. }
  17. }
英文:

You can get columnId with this query:

  1. query {
  2. repository(name: "website", owner: "delbaoliveira") {
  3. project(number: 1) {
  4. name
  5. columns(first: 1) {
  6. nodes {
  7. id
  8. name
  9. }
  10. }
  11. }
  12. }
  13. }

But also you can go ahead and get column data without columnId like this:

  1. query {
  2. repository(name: "website", owner: "delbaoliveira") {
  3. project(number: 1) {
  4. name
  5. columns(first: 1) {
  6. nodes {
  7. name
  8. cards {
  9. nodes {
  10. note
  11. }
  12. }
  13. }
  14. }
  15. }
  16. }
  17. }

huangapple
  • 本文由 发表于 2023年6月13日 16:58:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463256.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定