requireSchemas loads the schemas that scaffolding the targets needs. Unlike checks, scaffolding can't go ahead without them.
(chk *checker, targets []string, responses responseSet)
| 140 | // requireSchemas loads the schemas that scaffolding the targets needs. Unlike |
| 141 | // checks, scaffolding can't go ahead without them. |
| 142 | func requireSchemas(chk *checker, targets []string, responses responseSet) error { |
| 143 | for _, name := range targets { |
| 144 | method, target, _ := strings.Cut(name, " ") |
| 145 | switch { |
| 146 | case method == "graphql": |
| 147 | if _, err := chk.graphQL(); err != nil { |
| 148 | return fmt.Errorf("scaffolding needs GitHub's GraphQL schema: %w", err) |
| 149 | } |
| 150 | case strings.HasPrefix(target, "/") && len(responses[name]) == 0: |
| 151 | if _, err := chk.rest(); err != nil { |
| 152 | return fmt.Errorf("scaffolding needs GitHub's REST description: %w", err) |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | // sentQuery is a GraphQL query gh sent, with its variables. |
| 160 | type sentQuery struct { |
no test coverage detected