MCPcopy Create free account
hub / github.com/cli/cli / askedFields

Function askedFields

script/ghmock/report.go:378–396  ·  view source on GitHub ↗

askedFields lists the fields that GraphQL requests with this name asked for, or nil if there were none whose query could be read.

(requests []loggedRequest, name string)

Source from the content-addressed store, hash-verified

376// askedFields lists the fields that GraphQL requests with this name asked
377// for, or nil if there were none whose query could be read.
378func askedFields(requests []loggedRequest, name string) map[string]bool {
379 var fields map[string]bool
380 for _, e := range requests {
381 if displayName(e) != name || e.GraphQL == nil {
382 continue
383 }
384 paths := queryFields(e.GraphQL.Query, e.GraphQL.Operation)
385 if paths == nil {
386 continue
387 }
388 if fields == nil {
389 fields = map[string]bool{}
390 }
391 for path := range paths {
392 fields[path] = true
393 }
394 }
395 return fields
396}
397
398// joinLimited joins items, showing at most limit of them.
399func joinLimited(items []string, limit int) string {

Callers 1

printDifferencesFunction · 0.85

Calls 2

queryFieldsFunction · 0.85
displayNameFunction · 0.70

Tested by

no test coverage detected