| 348 | } |
| 349 | |
| 350 | func (d *detector) ProjectFeatures() (ProjectFeatures, error) { |
| 351 | if !ghauth.IsEnterprise(d.host) { |
| 352 | return allProjectFeatures, nil |
| 353 | } |
| 354 | |
| 355 | var features ProjectFeatures |
| 356 | |
| 357 | var featureDetection struct { |
| 358 | ProjectV2 struct { |
| 359 | Fields []struct { |
| 360 | Name string |
| 361 | Args []struct { |
| 362 | Name string |
| 363 | } |
| 364 | } `graphql:"fields(includeDeprecated: true)"` |
| 365 | } `graphql:"ProjectV2: __type(name: \"ProjectV2\")"` |
| 366 | } |
| 367 | |
| 368 | gql := api.NewClientFromHTTP(d.httpClient) |
| 369 | err := gql.Query(d.host, "ProjectV2_fields", &featureDetection, nil) |
| 370 | if err != nil { |
| 371 | return features, err |
| 372 | } |
| 373 | |
| 374 | for _, field := range featureDetection.ProjectV2.Fields { |
| 375 | if field.Name == "items" { |
| 376 | for _, arg := range field.Args { |
| 377 | if arg.Name == "query" { |
| 378 | features.ProjectItemQuery = true |
| 379 | break |
| 380 | } |
| 381 | } |
| 382 | break |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | return features, nil |
| 387 | } |
| 388 | |
| 389 | const ( |
| 390 | // enterpriseAdvancedIssueSearchSupport is the minimum version of GHES that |