(items int)
| 384 | } |
| 385 | |
| 386 | func generateMultiLevelMutationData(items int) Restaurants { |
| 387 | var restaurants Restaurants |
| 388 | ci := 1 |
| 389 | di := 1 |
| 390 | ri := 1 |
| 391 | for ; ri <= items; ri++ { |
| 392 | r := Restaurant{ |
| 393 | Xid: fmt.Sprintf("Test_Restaurant_%d", ri), |
| 394 | Name: "TypeRestaurantAuth", |
| 395 | Currency: "$", |
| 396 | } |
| 397 | var cuisines Cuisines |
| 398 | for ; ci%items != 0; ci++ { |
| 399 | c := Cuisine{ |
| 400 | Name: fmt.Sprintf("Test_Cuisine_%d", ci), |
| 401 | Type: "TypeCuisineAuth", |
| 402 | Public: true, |
| 403 | } |
| 404 | var dishes []Dish |
| 405 | for ; di%items != 0; di++ { |
| 406 | d := Dish{ |
| 407 | Name: fmt.Sprintf("Test_Dish_%d", di), |
| 408 | Type: "TypeDishAuth", |
| 409 | } |
| 410 | dishes = append(dishes, d) |
| 411 | } |
| 412 | di++ |
| 413 | c.Dishes = dishes |
| 414 | cuisines = append(cuisines, c) |
| 415 | } |
| 416 | ci++ |
| 417 | r.Cuisines = cuisines |
| 418 | restaurants = append(restaurants, r) |
| 419 | } |
| 420 | return restaurants |
| 421 | } |
| 422 | |
| 423 | func BenchmarkMultiLevelMutation(b *testing.B) { |
| 424 | schemaFile := "schema_auth.graphql" |
no outgoing calls
no test coverage detected