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

Function processQuery

query/vector/vector_test.go:58–77  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, query string)

Source from the content-addressed store, hash-verified

56}
57
58func processQuery(ctx context.Context, t *testing.T, query string) (string, error) {
59 txn := client.NewTxn()
60 defer func() {
61 if err := txn.Discard(ctx); err != nil {
62 t.Logf("error discarding txn: %v", err)
63 }
64 }()
65
66 res, err := txn.Query(ctx, query)
67 if err != nil {
68 return "", err
69 }
70
71 response := map[string]interface{}{}
72 response["data"] = json.RawMessage(string(res.Json))
73
74 jsonResponse, err := json.Marshal(response)
75 require.NoError(t, err)
76 return string(jsonResponse), err
77}
78
79func processQueryRDF(ctx context.Context, t *testing.T, query string) (string, error) {
80 txn := client.NewTxn()

Callers 1

processQueryNoErrFunction · 0.70

Calls 1

QueryMethod · 0.45

Tested by

no test coverage detected