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

Function optimisticResponse

client/src/mutations/updateTopicSynonymsMutation.ts:32–51  ·  view source on GitHub ↗
(repoTopic: RepoTopicType, synonymUpdate: SynonymType[])

Source from the content-addressed store, hash-verified

30}
31
32function optimisticResponse(repoTopic: RepoTopicType, synonymUpdate: SynonymType[]) {
33 const synonyms = repoTopic.details?.synonyms || []
34
35 return {
36 updateTopicSynonyms: {
37 clientMutationId: null,
38 alerts: [],
39 updatedTopic: {
40 id: repoTopic.topicId,
41 displayName: displayName(synonyms, repoTopic.timerangePrefix),
42 },
43 updatedRepoTopic: {
44 ...repoTopic,
45 details: {
46 synonyms: synonymUpdate,
47 },
48 },
49 },
50 }
51}
52
53const query = graphql`
54 mutation updateTopicSynonymsMutation($input: UpdateTopicSynonymsInput!) {

Callers 1

Calls 1

displayNameFunction · 0.85

Tested by

no test coverage detected