lastQuery returns the query gh most recently sent for a GraphQL request name, or "" if it hasn't sent one.
(st *state, name string)
| 284 | // lastQuery returns the query gh most recently sent for a GraphQL request |
| 285 | // name, or "" if it hasn't sent one. |
| 286 | func lastQuery(st *state, name string) (string, error) { |
| 287 | entries, err := st.readLog() |
| 288 | if err != nil { |
| 289 | return "", err |
| 290 | } |
| 291 | for _, entrie := range slices.Backward(entries) { |
| 292 | if entrie.Name == name && entrie.GraphQL != nil { |
| 293 | return entrie.GraphQL.Query, nil |
| 294 | } |
| 295 | } |
| 296 | return "", nil |
| 297 | } |
| 298 | |
| 299 | // applySet changes one stored response and returns its position. |
| 300 | func applySet(responses responseSet, opts setOptions) (int, error) { |