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

Method applies

script/ghmock/trim.go:142–150  ·  view source on GitHub ↗

applies reports whether a fragment on cond applies to an object whose __typename is typename. Without a __typename, every fragment applies.

(cond, typename string)

Source from the content-addressed store, hash-verified

140// applies reports whether a fragment on cond applies to an object whose
141// __typename is typename. Without a __typename, every fragment applies.
142func (t *trimmer) applies(cond, typename string) bool {
143 if cond == "" || typename == "" || cond == typename {
144 return true
145 }
146 if t.schema == nil || t.schema.Types[typename] == nil {
147 return true
148 }
149 return isA(t.schema, t.schema.Types[typename], cond)
150}
151
152// queryFields lists the response paths a query asks for, such as
153// data.repository.issue.title. Fragments are flattened, as they are in the

Callers 1

collectMethod · 0.95

Calls 1

isAFunction · 0.85

Tested by

no test coverage detected