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

Function processQueryWithVars

query/vector/vector_test.go:109–125  ·  view source on GitHub ↗
(t *testing.T, query string,
	vars map[string]string)

Source from the content-addressed store, hash-verified

107}
108
109func processQueryWithVars(t *testing.T, query string,
110 vars map[string]string) (string, error) {
111 txn := client.NewTxn()
112 defer func() { _ = txn.Discard(context.Background()) }()
113
114 res, err := txn.QueryWithVars(context.Background(), query, vars)
115 if err != nil {
116 return "", err
117 }
118
119 response := map[string]interface{}{}
120 response["data"] = json.RawMessage(string(res.Json))
121
122 jsonResponse, err := json.Marshal(response)
123 require.NoError(t, err)
124 return string(jsonResponse), err
125}
126
127func addTriplesToCluster(triples string) error {
128 txn := client.NewTxn()

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected