(payload: RecordProxy<{}>)
| 9 | } from '__generated__/upsertLinkMutation.graphql' |
| 10 | |
| 11 | function hasErrors(payload: RecordProxy<{}>) { |
| 12 | const errors = (payload.getLinkedRecords('alerts') || []).filter((alert: RecordProxy<{}>) => { |
| 13 | return alert.getValue('type') == 'ERROR' |
| 14 | }) |
| 15 | |
| 16 | if (errors.length !== 0) { |
| 17 | console.log('errors present, not updating link connection') |
| 18 | return true |
| 19 | } |
| 20 | |
| 21 | return false |
| 22 | } |
| 23 | |
| 24 | function makeUpdater(parentTopicId: string | null) { |
| 25 | if (!parentTopicId) return null |