(ctx context.Context, t *testing.T, query string)
| 45 | } |
| 46 | |
| 47 | func processQuery(ctx context.Context, t *testing.T, query string) (string, error) { |
| 48 | txn := client.NewTxn() |
| 49 | defer func() { |
| 50 | if err := txn.Discard(ctx); err != nil { |
| 51 | t.Logf("error discarding txn: %v", err) |
| 52 | } |
| 53 | }() |
| 54 | |
| 55 | res, err := txn.Query(ctx, query) |
| 56 | if err != nil { |
| 57 | return "", err |
| 58 | } |
| 59 | |
| 60 | response := map[string]interface{}{} |
| 61 | response["data"] = json.RawMessage(string(res.Json)) |
| 62 | |
| 63 | jsonResponse, err := json.Marshal(response) |
| 64 | require.NoError(t, err) |
| 65 | return string(jsonResponse), err |
| 66 | } |
| 67 | |
| 68 | func processQueryRDF(ctx context.Context, query string) (string, error) { |
| 69 | txn := client.NewTxn() |
no test coverage detected