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

Function cmdSchema

script/ghmock/schemacmd.go:60–78  ·  view source on GitHub ↗
(args []string, stdout, stderr io.Writer)

Source from the content-addressed store, hash-verified

58}
59
60func cmdSchema(args []string, stdout, stderr io.Writer) error {
61 opts, err := parseSchemaArgs(args)
62 if err != nil {
63 return err
64 }
65 chk := newChecker(stderr)
66 if opts.isREST() {
67 idx, err := chk.rest()
68 if err != nil {
69 return err
70 }
71 return describeREST(stdout, idx, opts)
72 }
73 schema, err := chk.graphQL()
74 if err != nil {
75 return err
76 }
77 return describeGraphQL(stdout, schema, opts.name)
78}
79
80// describeGraphQL writes what GitHub's GraphQL schema says about a type or a
81// field.

Callers 2

TestCmdSchemaFunction · 0.85
runMainFunction · 0.85

Calls 7

parseSchemaArgsFunction · 0.85
newCheckerFunction · 0.85
describeRESTFunction · 0.85
describeGraphQLFunction · 0.85
isRESTMethod · 0.80
restMethod · 0.80
graphQLMethod · 0.80

Tested by 1

TestCmdSchemaFunction · 0.68