MCPcopy Create free account
hub / github.com/emwalker/digraph / makeUpdater

Function makeUpdater

client/src/mutations/upsertTopicMutation.ts:52–68  ·  view source on GitHub ↗
(parentTopicId: string)

Source from the content-addressed store, hash-verified

50}
51
52function makeUpdater(parentTopicId: string) {
53 return (store: RecordSourceSelectorProxy) => {
54 const payload = store.getRootField('upsertTopic')
55 if (!payload) {
56 console.log('payload not found in mutation response')
57 return
58 }
59
60 const topicEdge = payload.getLinkedRecord('topicEdge')
61 if (!topicEdge) {
62 console.log('no topic edge found in mutation response')
63 return
64 }
65
66 return insertEdge(parentTopicId, store, topicEdge)
67 }
68}
69
70const query = graphql`
71 mutation upsertTopicMutation(

Callers 1

makeUpsertTopicFunction · 0.70

Calls 1

insertEdgeFunction · 0.85

Tested by

no test coverage detected