(t *testing.T)
| 318 | } |
| 319 | |
| 320 | func TestJSONQueryVariables(t *testing.T) { |
| 321 | |
| 322 | q := `query test ($a: int = 1) { |
| 323 | me(func: uid(0x01)) { |
| 324 | name |
| 325 | gender |
| 326 | friend(first: $a) { |
| 327 | name |
| 328 | } |
| 329 | } |
| 330 | }` |
| 331 | js, err := processQueryWithVars(t, q, map[string]string{"$a": "2"}) |
| 332 | require.NoError(t, err) |
| 333 | require.JSONEq(t, `{"data": {"me":[{"friend":[{"name":"Rick Grimes"},{"name":"Glenn Rhee"}],"gender":"female","name":"Michonne"}]}}`, js) |
| 334 | } |
| 335 | |
| 336 | func TestGraphQLVarsInUpsert(t *testing.T) { |
| 337 | req := &api.Request{ |
nothing calls this directly
no test coverage detected