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

Function processQueryWithVars

query/common_test.go:98–114  ·  view source on GitHub ↗
(t *testing.T, query string,
	vars map[string]string)

Source from the content-addressed store, hash-verified

96}
97
98func processQueryWithVars(t *testing.T, query string,
99 vars map[string]string) (string, error) {
100 txn := client.NewTxn()
101 defer func() { _ = txn.Discard(context.Background()) }()
102
103 res, err := txn.QueryWithVars(context.Background(), query, vars)
104 if err != nil {
105 return "", err
106 }
107
108 response := map[string]interface{}{}
109 response["data"] = json.RawMessage(string(res.Json))
110
111 jsonResponse, err := json.Marshal(response)
112 require.NoError(t, err)
113 return string(jsonResponse), err
114}
115
116func addTriplesToCluster(triples string) error {
117 txn := client.NewTxn()

Calls

no outgoing calls

Tested by

no test coverage detected