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

Method collectFragment

script/ghmock/graphqlcheck.go:249–263  ·  view source on GitHub ↗
(cond string, dirs ast.DirectiveList, sel ast.SelectionSet, concrete *ast.Definition, required, checked bool, out *[]selected)

Source from the content-addressed store, hash-verified

247}
248
249func (w *gqlWalker) collectFragment(cond string, dirs ast.DirectiveList, sel ast.SelectionSet, concrete *ast.Definition, required, checked bool, out *[]selected) {
250 included, known := directiveCondition(dirs, w.variables)
251 if !included {
252 return
253 }
254 required = required && known
255 switch {
256 case cond == "":
257 case concrete == nil:
258 required, checked = false, false
259 case !w.isA(concrete, cond):
260 return
261 }
262 w.collectFields(sel, concrete, required, checked, out)
263}
264
265func directiveCondition(dirs ast.DirectiveList, variables map[string]any) (included, known bool) {
266 known = true

Callers 1

collectFieldsMethod · 0.95

Calls 3

isAMethod · 0.95
collectFieldsMethod · 0.95
directiveConditionFunction · 0.85

Tested by

no test coverage detected