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

Function graphQLErrorText

script/ghmock/graphqlcheck.go:122–130  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

120}
121
122func graphQLErrorText(err error) string {
123 if ge, ok := errors.AsType[*gqlerror.Error](err); ok {
124 if len(ge.Locations) > 0 {
125 return formatGraphQLError(ge.Message, ge.Locations[0].Line, ge.Locations[0].Column)
126 }
127 return ge.Message
128 }
129 return err.Error()
130}
131
132// checkGraphQLResponse compares a response body with the query gh sent. Paths
133// in problems use the same dotted form as ghmock set --at.

Callers 2

loadGraphQLSchemaFunction · 0.85
checkGraphQLQueryFunction · 0.85

Calls 2

formatGraphQLErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected