(dirs ast.DirectiveList)
| 395 | } |
| 396 | |
| 397 | func deprecationReason(dirs ast.DirectiveList) any { |
| 398 | d := dirs.ForName("deprecated") |
| 399 | if d == nil { |
| 400 | return nil |
| 401 | } |
| 402 | if a := d.Arguments.ForName("reason"); a != nil { |
| 403 | return a.Value.Raw |
| 404 | } |
| 405 | return "No longer supported" |
| 406 | } |
| 407 | |
| 408 | // optional turns an empty description into null, as GitHub returns it. |
| 409 | func optional(text string) any { |