(ctx context.Context, t *testing.T, query string)
| 56 | } |
| 57 | |
| 58 | func 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 | |
| 79 | func processQueryRDF(ctx context.Context, t *testing.T, query string) (string, error) { |
| 80 | txn := client.NewTxn() |
no test coverage detected