Skip to main content

Diff

Diffs represent the changes to search or folder counts as a result of a mutation.

Clients can read the diff(s) from a mutation, and apply those deltas to their cached folder counts without having to re-query the API for the correct counts.

In some cases it's possible to guess how a particular mutation might affect folder counts. Indeed, the Groove apps generally try to make an optimistic guess while the mutation request is in-flight.

Often, however, it's non-trivial to do so, and in some cases not possible. It's more more correct to rely on the API to provide the correct numbers, and these are provided conveniently inside mutation diffs.

For example, say you have a "question" tag, and there are 20 conversations with that tag applied. Then, an agent triggers a conversationUntag mutation for the "question" tag on one of those conversations. That mutation will then return a diff field showing a -1 delta for the general search query for that tag. For example:

"diffs" => [
"tag:tag_1234567" => -1,
]

The client could then cheaply recompute their cached counts for that tag, and update any previously cached search result counts.

Similarly, if you also had a folder whose rule matches all "question" tags as well, then that same mutation might result in a folder diff field like so:

"diffs" => [
"tag:tag_1234567" => -1,
"folder:fol_2345678" => -1,
]

The client could use this information to quickly update any visible folder counts without having to re-query the API.

Finally, diffs are also provided at the 'All Channels' level (like above) and for individual channels. If there was a channel where the above folder was visible, the diff results would look something like so:

"diffs" => [
"tag:tag_1234567" => -1,
"folder:fol_2345678" => -1,
"channel:ch_4567890 folder:fol_2345678" => -1,
]
type Diff {
delta: Int
query: String!
}

Fields

Diff.delta ● Int scalar common

The difference in the count of conversations that now match this query.

Diff.query ● String! non-null scalar common

The query string representing a search or folder, for example is:open.

Member of

conversationAddNotePayload object ● ConversationAssignPayload object ● ConversationChangeChannelPayload object ● ConversationChangeContactPayload object ● ConversationClosePayload object ● ConversationCreateEmailPayload object ● conversationDeleteNotePayload object ● ConversationDeletePayload object ● conversationEditNotePayload object ● ConversationFollowPayload object ● ConversationForwardPayload object ● ConversationForwardV2Payload object ● conversationLinkResourcePayload object ● ConversationLogPayload object ● ConversationMergePayload object ● ConversationOpenPayload object ● ConversationReplyPayload object ● conversationRestorePayload object ● ConversationSnoozePayload object ● ConversationSpamPayload object ● ConversationStarPayload object ● ConversationSubjectPayload object ● ConversationTagPayload object ● conversationToggleNoteReactionPayload object ● ConversationTrashPayload object ● ConversationUnassignPayload object ● conversationUndoSendPayload object ● ConversationUnfollowPayload object ● ConversationUnreadPayload object ● ConversationUnstarPayload object ● ConversationUntagPayload object