MCPcopy
hub / github.com/dgraph-io/dgraph / Output

Method Output

graphql/schema/response.go:144–168  ·  view source on GitHub ↗

Output returns json interface of the response

()

Source from the content-addressed store, hash-verified

142
143// Output returns json interface of the response
144func (r *Response) Output() interface{} {
145 if r == nil {
146 return struct {
147 Errors json.RawMessage `json:"errors,omitempty"`
148 Data json.RawMessage `json:"data,omitempty"`
149 }{
150 Errors: []byte(`[{"message": "Internal error - no response to write."}]`),
151 Data: JsonNull,
152 }
153 }
154
155 res := struct {
156 Errors []*x.GqlError `json:"errors,omitempty"`
157 Data json.RawMessage `json:"data,omitempty"`
158 Extensions *Extensions `json:"extensions,omitempty"`
159 }{
160 Errors: r.Errors,
161 Data: r.Data.Bytes(),
162 }
163
164 if x.Config.GraphQL.GetBool("extensions") {
165 res.Extensions = r.Extensions
166 }
167 return res
168}
169
170// Extensions represents GraphQL extensions
171type Extensions struct {

Callers 10

WriteToMethod · 0.95
shellOutputFunction · 0.80
matchExportCountFunction · 0.80
dirCleanupFunction · 0.80
getMemUsageFunction · 0.80
VerifyCurlCmdFunction · 0.80
getPortMappingsOnMacFunction · 0.80
Test21MillionDataSetSizeFunction · 0.80
AddSubscriberMethod · 0.80
pollMethod · 0.80

Calls

no outgoing calls

Tested by 2

dirCleanupFunction · 0.64
Test21MillionDataSetSizeFunction · 0.64