File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -58,22 +58,25 @@ func CallGithubApi() {
58
58
var listquery struct {
59
59
Organization struct {
60
60
Projectv2 struct {
61
- Nodes struct {
62
- id string
63
- title string
61
+ Nodes [] struct {
62
+ Id string
63
+ Title string
64
64
}
65
65
} `graphql:"projectsV2(first: 20)"`
66
- } `graphql:"organization(login: \"open-connectors\" )"`
66
+ } `graphql:"organization(login: $orgname )"`
67
67
}
68
- // variables = map[string]interface{}{
69
- // "orgname": githubv4.String("open-connectors"),
70
- // }
71
- err = client .Query (context .Background (), & listquery , nil )
68
+ variables = map [string ]interface {}{
69
+ "orgname" : githubv4 .String ("open-connectors" ),
70
+ }
71
+ err = client .Query (context .Background (), & listquery , variables )
72
72
if err != nil {
73
73
fmt .Println (err )
74
74
}
75
- // fmt.Println(listquery.Organization.Name)
76
- fmt .Println (listquery .Organization .Projectv2 .Nodes )
75
+ nodes := listquery .Organization .Projectv2 .Nodes
76
+ for _ , node := range nodes {
77
+ fmt .Println (node .Id )
78
+ fmt .Println (node .Title )
79
+ }
77
80
}
78
81
79
82
// printJSON prints v as JSON encoded with indent to stdout. It panics on any error.
You can’t perform that action at this time.
0 commit comments