(b *testing.B)
| 218 | } |
| 219 | |
| 220 | func BenchmarkOneLevelQuery(b *testing.B) { |
| 221 | schemaFile := "schema_auth.graphql" |
| 222 | schema, err := os.ReadFile(schemaFile) |
| 223 | require.NoError(b, err) |
| 224 | |
| 225 | metaInfo := getAuthMeta(string(schema)) |
| 226 | metaInfo.AuthVars = map[string]interface{}{ |
| 227 | "Role": "ADMIN", |
| 228 | "Dish": "Dish", |
| 229 | "RName": "Restaurant", |
| 230 | "RCurr": "$", |
| 231 | } |
| 232 | |
| 233 | query := ` |
| 234 | query { |
| 235 | queryCuisine (first: 300000) { |
| 236 | id |
| 237 | name |
| 238 | } |
| 239 | } |
| 240 | ` |
| 241 | |
| 242 | getUserParams := &common.GraphQLParams{ |
| 243 | Headers: getJWT(b, metaInfo), |
| 244 | Query: query, |
| 245 | } |
| 246 | |
| 247 | for i := 0; i < b.N; i++ { |
| 248 | gqlResponse := getUserParams.ExecuteAsPost(b, graphqlURL) |
| 249 | require.Nilf(b, gqlResponse.Errors, "%+v", gqlResponse.Errors) |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | type Cuisine struct { |
| 254 | Id string `json:"id,omitempty"` |
nothing calls this directly
no test coverage detected