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

Function writeGraphQLFields

script/ghmock/schemacmd.go:143–154  ·  view source on GitHub ↗
(w io.Writer, fields ast.FieldList)

Source from the content-addressed store, hash-verified

141}
142
143func writeGraphQLFields(w io.Writer, fields ast.FieldList) {
144 for _, f := range fields {
145 if strings.HasPrefix(f.Name, "__") {
146 continue
147 }
148 line := fmt.Sprintf(" %s: %s", f.Name, f.Type.String())
149 if f.Directives.ForName("deprecated") != nil {
150 line += " (deprecated)"
151 }
152 fmt.Fprintln(w, line)
153 }
154}
155
156func writeGraphQLField(w io.Writer, schema *ast.Schema, def *ast.Definition, f *ast.FieldDefinition) {
157 input := def.Kind == ast.InputObject

Callers 1

writeGraphQLTypeFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected