MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / processToFastJSON

Function processToFastJSON

dgraph/cmd/alpha/run_test.go:72–92  ·  view source on GitHub ↗
(q string)

Source from the content-addressed store, hash-verified

70}
71
72func processToFastJSON(q string) string {
73 res, err := dql.Parse(dql.Request{Str: q})
74 if err != nil {
75 log.Fatal(err)
76 }
77
78 var l query.Latency
79 ctx := defaultContext()
80 qr := query.Request{Latency: &l, DqlQuery: &res, ReadTs: timestamp()}
81 err = qr.ProcessQuery(ctx)
82
83 if err != nil {
84 log.Fatal(err)
85 }
86
87 buf, err := query.ToJson(context.Background(), &l, qr.Subgraphs, nil)
88 if err != nil {
89 log.Fatal(err)
90 }
91 return string(buf)
92}
93
94func runGraphqlQuery(q string) (string, error) {
95 output, _, err := queryWithTs(queryInp{body: q, typ: "application/dql"})

Callers 1

BenchmarkQueryFunction · 0.85

Calls 6

ProcessQueryMethod · 0.95
ParseFunction · 0.92
ToJsonFunction · 0.92
defaultContextFunction · 0.85
FatalMethod · 0.80
timestampFunction · 0.70

Tested by

no test coverage detected