| 324 | } |
| 325 | |
| 326 | func (d *detector) ProjectFeatures() (ProjectFeatures, error) { |
| 327 | if !ghauth.IsEnterprise(d.host) { |
| 328 | return allProjectFeatures, nil |
| 329 | } |
| 330 | |
| 331 | var features ProjectFeatures |
| 332 | |
| 333 | var featureDetection struct { |
| 334 | ProjectV2 struct { |
| 335 | Fields []struct { |
| 336 | Name string |
| 337 | Args []struct { |
| 338 | Name string |
| 339 | } |
| 340 | } `graphql:"fields(includeDeprecated: true)"` |
| 341 | } `graphql:"ProjectV2: __type(name: \"ProjectV2\")"` |
| 342 | } |
| 343 | |
| 344 | gql := api.NewClientFromHTTP(d.httpClient) |
| 345 | err := gql.Query(d.host, "ProjectV2_fields", &featureDetection, nil) |
| 346 | if err != nil { |
| 347 | return features, err |
| 348 | } |
| 349 | |
| 350 | for _, field := range featureDetection.ProjectV2.Fields { |
| 351 | if field.Name == "items" { |
| 352 | for _, arg := range field.Args { |
| 353 | if arg.Name == "query" { |
| 354 | features.ProjectItemQuery = true |
| 355 | break |
| 356 | } |
| 357 | } |
| 358 | break |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | return features, nil |
| 363 | } |
| 364 | |
| 365 | const ( |
| 366 | // enterpriseAdvancedIssueSearchSupport is the minimum version of GHES that |