Skip to content

Commit 1a430da

Browse files
committed
temporarily enrich project items query
1 parent b2ac793 commit 1a430da

File tree

1 file changed

+108
-6
lines changed

1 file changed

+108
-6
lines changed

pkg/github/projects.go

Lines changed: 108 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,62 @@ func GetProjectItems(getClient GetGQLClientFn, t translations.TranslationHelperF
171171
var q struct {
172172
User struct {
173173
Project struct {
174-
Items struct {
175-
Nodes []struct {
176-
ID githubv4.ID
174+
Items struct {
175+
Nodes []struct {
176+
ID githubv4.ID
177+
FieldValues struct {
178+
Nodes []struct {
179+
ProjectV2ItemFieldTextValue struct {
180+
Text githubv4.String
181+
Field struct {
182+
ProjectV2FieldCommon struct {
183+
Name githubv4.String
184+
} `graphql:"... on ProjectV2FieldCommon"`
185+
}
186+
} `graphql:"... on ProjectV2ItemFieldTextValue"`
187+
ProjectV2ItemFieldDateValue struct {
188+
Date githubv4.Date
189+
Field struct {
190+
ProjectV2FieldCommon struct {
191+
Name githubv4.String
192+
} `graphql:"... on ProjectV2FieldCommon"`
193+
}
194+
} `graphql:"... on ProjectV2ItemFieldDateValue"`
195+
ProjectV2ItemFieldSingleSelectValue struct {
196+
Name githubv4.String
197+
Field struct {
198+
ProjectV2FieldCommon struct {
199+
Name githubv4.String
200+
} `graphql:"... on ProjectV2FieldCommon"`
201+
}
202+
} `graphql:"... on ProjectV2ItemFieldSingleSelectValue"`
203+
}
204+
} `graphql:"fieldValues(first: 8)"`
205+
Content struct {
206+
DraftIssue struct {
207+
Title githubv4.String
208+
Body githubv4.String
209+
} `graphql:"... on DraftIssue"`
210+
Issue struct {
211+
Title githubv4.String
212+
Assignees struct {
213+
Nodes []struct {
214+
Login githubv4.String
215+
}
216+
} `graphql:"assignees(first: 10)"`
217+
} `graphql:"... on Issue"`
218+
PullRequest struct {
219+
Title githubv4.String
220+
Assignees struct {
221+
Nodes []struct {
222+
Login githubv4.String
223+
}
224+
} `graphql:"assignees(first: 10)"`
225+
} `graphql:"... on PullRequest"`
177226
}
178-
} `graphql:"items(first: 100)"`
179-
} `graphql:"projectV2(number: $number)"`
227+
}
228+
} `graphql:"items(first: 100)"`
229+
} `graphql:"projectV2(number: $number)"`
180230
} `graphql:"user(login: $login)"`
181231
}
182232
if err := client.Query(ctx, &q, map[string]any{"login": githubv4.String(owner), "number": githubv4.Int(number)}); err != nil {
@@ -188,7 +238,59 @@ func GetProjectItems(getClient GetGQLClientFn, t translations.TranslationHelperF
188238
Organization struct {
189239
Project struct {
190240
Items struct {
191-
Nodes []struct{ ID githubv4.ID }
241+
Nodes []struct {
242+
ID githubv4.ID
243+
FieldValues struct {
244+
Nodes []struct {
245+
ProjectV2ItemFieldTextValue struct {
246+
Text githubv4.String
247+
Field struct {
248+
ProjectV2FieldCommon struct {
249+
Name githubv4.String
250+
} `graphql:"... on ProjectV2FieldCommon"`
251+
}
252+
} `graphql:"... on ProjectV2ItemFieldTextValue"`
253+
ProjectV2ItemFieldDateValue struct {
254+
Date githubv4.Date
255+
Field struct {
256+
ProjectV2FieldCommon struct {
257+
Name githubv4.String
258+
} `graphql:"... on ProjectV2FieldCommon"`
259+
}
260+
} `graphql:"... on ProjectV2ItemFieldDateValue"`
261+
ProjectV2ItemFieldSingleSelectValue struct {
262+
Name githubv4.String
263+
Field struct {
264+
ProjectV2FieldCommon struct {
265+
Name githubv4.String
266+
} `graphql:"... on ProjectV2FieldCommon"`
267+
}
268+
} `graphql:"... on ProjectV2ItemFieldSingleSelectValue"`
269+
}
270+
} `graphql:"fieldValues(first: 8)"`
271+
Content struct {
272+
DraftIssue struct {
273+
Title githubv4.String
274+
Body githubv4.String
275+
} `graphql:"... on DraftIssue"`
276+
Issue struct {
277+
Title githubv4.String
278+
Assignees struct {
279+
Nodes []struct {
280+
Login githubv4.String
281+
}
282+
} `graphql:"assignees(first: 10)"`
283+
} `graphql:"... on Issue"`
284+
PullRequest struct {
285+
Title githubv4.String
286+
Assignees struct {
287+
Nodes []struct {
288+
Login githubv4.String
289+
}
290+
} `graphql:"assignees(first: 10)"`
291+
} `graphql:"... on PullRequest"`
292+
}
293+
}
192294
} `graphql:"items(first: 100)"`
193295
} `graphql:"projectV2(number: $number)"`
194296
} `graphql:"organization(login: $login)"`

0 commit comments

Comments
 (0)