| 387 | } |
| 388 | |
| 389 | func (d *detector) ProjectFeatures() (ProjectFeatures, error) { |
| 390 | if !ghauth.IsEnterprise(d.host) { |
| 391 | return allProjectFeatures, nil |
| 392 | } |
| 393 | |
| 394 | var features ProjectFeatures |
| 395 | |
| 396 | var featureDetection struct { |
| 397 | ProjectV2 struct { |
| 398 | Fields []struct { |
| 399 | Name string |
| 400 | Args []struct { |
| 401 | Name string |
| 402 | } |
| 403 | } `graphql:"fields(includeDeprecated: true)"` |
| 404 | } `graphql:"ProjectV2: __type(name: \"ProjectV2\")"` |
| 405 | } |
| 406 | |
| 407 | gql := api.NewClientFromHTTP(d.client()) |
| 408 | err := gql.Query(d.host, "ProjectV2_fields", &featureDetection, nil) |
| 409 | if err != nil { |
| 410 | return features, err |
| 411 | } |
| 412 | |
| 413 | for _, field := range featureDetection.ProjectV2.Fields { |
| 414 | if field.Name == "items" { |
| 415 | for _, arg := range field.Args { |
| 416 | if arg.Name == "query" { |
| 417 | features.ProjectItemQuery = true |
| 418 | break |
| 419 | } |
| 420 | } |
| 421 | break |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | return features, nil |
| 426 | } |
| 427 | |
| 428 | const ( |
| 429 | // enterpriseAdvancedIssueSearchSupport is the minimum version of GHES that |