Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

Seanaye/feat/more mutations (#5278)

Sean Ayec93501940007
diff --git a/.github/workspace-dep-closures.json b/.github/workspace-dep-closures.json
index 3a900a9559..d1a0d40e0c 100644
--- a/.github/workspace-dep-closures.json
+++ b/.github/workspace-dep-closures.json
@@ -921,6 +921,7 @@
"crates/filter_ast",
"crates/foreign_entity",
"crates/frecency",
+ "crates/graphql_channel",
"crates/graphql_common",
"crates/graphql_email",
"crates/graphql_entity_mutation",
@@ -1527,6 +1528,7 @@
"crates/fusionauth",
"crates/generic_email_domains",
"crates/github",
+ "crates/graphql_channel",
"crates/graphql_common",
"crates/graphql_email",
"crates/graphql_entity_mutation",
@@ -2661,6 +2663,73 @@
"crates/models_pagination",
"crates/workspace-hack"
],
+ "graphql_channel": [
+ "crates/agent",
+ "crates/ai_toolset",
+ "crates/ai_usage",
+ "crates/attachment",
+ "crates/authentication_service_client",
+ "crates/bot_id",
+ "crates/channel_sender",
+ "crates/channels",
+ "crates/connection_gateway_client",
+ "crates/connection_gateway_models",
+ "crates/contacts",
+ "crates/cowlike",
+ "crates/crm",
+ "crates/document_sub_type",
+ "crates/email",
+ "crates/email_db_client",
+ "crates/email_utils",
+ "crates/entity_access",
+ "crates/entity_access_db_utils",
+ "crates/entity_access_management",
+ "crates/entity_mutation",
+ "crates/filter_ast",
+ "crates/frecency",
+ "crates/graphql_channel",
+ "crates/graphql_common",
+ "crates/invite_email",
+ "crates/item_filters",
+ "crates/kafka_util",
+ "crates/last_online_tracker",
+ "crates/macro_auth",
+ "crates/macro_authorization",
+ "crates/macro_env",
+ "crates/macro_env_var",
+ "crates/macro_event_broker",
+ "crates/macro_event_topics",
+ "crates/macro_service_urls",
+ "crates/macro_user_id",
+ "crates/macro_uuid",
+ "crates/mention_utils",
+ "crates/model",
+ "crates/model-entity",
+ "crates/model-error-response",
+ "crates/model_file_type",
+ "crates/model_notifications",
+ "crates/model_user",
+ "crates/models_ai_projection",
+ "crates/models_bulk_upload",
+ "crates/models_email",
+ "crates/models_entity_access_management",
+ "crates/models_pagination",
+ "crates/models_permissions",
+ "crates/models_properties",
+ "crates/non_empty",
+ "crates/notification",
+ "crates/prompt",
+ "crates/properties",
+ "crates/rate_limit",
+ "crates/remote_env_var",
+ "crates/s3_key",
+ "crates/share_permission_db_utils",
+ "crates/sqs_client",
+ "crates/sqs_worker",
+ "crates/system_properties",
+ "crates/unfurl",
+ "crates/workspace-hack"
+ ],
"graphql_common": [
"crates/bot_id",
"crates/cowlike",
diff --git a/.sqlx/query-015a45b5c16b4bcc135372478d585af4ce10f5f6ae5e3578637b66655ea6d67e.json b/.sqlx/query-015a45b5c16b4bcc135372478d585af4ce10f5f6ae5e3578637b66655ea6d67e.json
deleted file mode 100644
index 4d54ccbb50..0000000000
--- a/.sqlx/query-015a45b5c16b4bcc135372478d585af4ce10f5f6ae5e3578637b66655ea6d67e.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH updated AS (\n UPDATE user_notification\n SET done = $3\n WHERE user_id = $1 AND notification_id = ANY($2) AND deleted_at IS NULL\n RETURNING notification_id, done, seen_at::timestamptz as viewed_at\n )\n SELECT\n updated.notification_id,\n updated.done,\n updated.viewed_at,\n NOW()::timestamptz as \"updated_at!\"\n FROM updated\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "notification_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "done",
- "type_info": "Bool"
- },
- {
- "ordinal": 2,
- "name": "viewed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "updated_at!",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "UuidArray",
- "Bool"
- ]
- },
- "nullable": [
- false,
- false,
- null,
- null
- ]
- },
- "hash": "015a45b5c16b4bcc135372478d585af4ce10f5f6ae5e3578637b66655ea6d67e"
-}
diff --git a/.sqlx/query-020ebdd2abf9a88f64650b24b5d996f7e57fe09467e3f5ee319f7008dae05673.json b/.sqlx/query-020ebdd2abf9a88f64650b24b5d996f7e57fe09467e3f5ee319f7008dae05673.json
new file mode 100644
index 0000000000..73309c1b89
--- /dev/null
+++ b/.sqlx/query-020ebdd2abf9a88f64650b24b5d996f7e57fe09467e3f5ee319f7008dae05673.json
@@ -0,0 +1,95 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n WITH updated AS (\n UPDATE user_notification\n SET seen_at = NOW()\n WHERE user_id = $1 AND notification_id = ANY($2) AND deleted_at IS NULL\n RETURNING\n user_id,\n notification_id,\n sent,\n done,\n created_at,\n seen_at,\n deleted_at\n )\n SELECT\n updated.user_id as owner_id,\n updated.notification_id,\n n.event_item_id,\n n.event_item_type,\n updated.sent,\n updated.done,\n updated.created_at::timestamptz as \"created_at!\",\n updated.seen_at::timestamptz as viewed_at,\n NOW()::timestamptz as \"updated_at!\",\n updated.deleted_at::timestamptz,\n n.metadata as \"notification_metadata: serde_json::Value\",\n n.notification_event_type,\n n.sender_id\n FROM updated\n JOIN notification n ON n.id = updated.notification_id\n ORDER BY array_position($2, updated.notification_id)\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "owner_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 1,
+ "name": "notification_id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 2,
+ "name": "event_item_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "event_item_type",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "sent",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 5,
+ "name": "done",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 6,
+ "name": "created_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 7,
+ "name": "viewed_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 8,
+ "name": "updated_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 9,
+ "name": "deleted_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 10,
+ "name": "notification_metadata: serde_json::Value",
+ "type_info": "Jsonb"
+ },
+ {
+ "ordinal": 11,
+ "name": "notification_event_type",
+ "type_info": "Varchar"
+ },
+ {
+ "ordinal": 12,
+ "name": "sender_id",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "UuidArray"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ null,
+ null,
+ null,
+ null,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "020ebdd2abf9a88f64650b24b5d996f7e57fe09467e3f5ee319f7008dae05673"
+}
diff --git a/.sqlx/query-5dbb7406738accd86527d1f9e42e330724b176a879d63640dbdd59925e881c17.json b/.sqlx/query-5dbb7406738accd86527d1f9e42e330724b176a879d63640dbdd59925e881c17.json
new file mode 100644
index 0000000000..ff88888572
--- /dev/null
+++ b/.sqlx/query-5dbb7406738accd86527d1f9e42e330724b176a879d63640dbdd59925e881c17.json
@@ -0,0 +1,96 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n WITH updated AS (\n UPDATE user_notification\n SET done = $3\n WHERE user_id = $1 AND notification_id = ANY($2) AND deleted_at IS NULL\n RETURNING\n user_id,\n notification_id,\n sent,\n done,\n created_at,\n seen_at,\n deleted_at\n )\n SELECT\n updated.user_id as owner_id,\n updated.notification_id,\n n.event_item_id,\n n.event_item_type,\n updated.sent,\n updated.done,\n updated.created_at::timestamptz as \"created_at!\",\n updated.seen_at::timestamptz as viewed_at,\n NOW()::timestamptz as \"updated_at!\",\n updated.deleted_at::timestamptz,\n n.metadata as \"notification_metadata: serde_json::Value\",\n n.notification_event_type,\n n.sender_id\n FROM updated\n JOIN notification n ON n.id = updated.notification_id\n ORDER BY array_position($2, updated.notification_id)\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "owner_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 1,
+ "name": "notification_id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 2,
+ "name": "event_item_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "event_item_type",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "sent",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 5,
+ "name": "done",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 6,
+ "name": "created_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 7,
+ "name": "viewed_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 8,
+ "name": "updated_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 9,
+ "name": "deleted_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 10,
+ "name": "notification_metadata: serde_json::Value",
+ "type_info": "Jsonb"
+ },
+ {
+ "ordinal": 11,
+ "name": "notification_event_type",
+ "type_info": "Varchar"
+ },
+ {
+ "ordinal": 12,
+ "name": "sender_id",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "UuidArray",
+ "Bool"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ null,
+ null,
+ null,
+ null,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "5dbb7406738accd86527d1f9e42e330724b176a879d63640dbdd59925e881c17"
+}
diff --git a/.sqlx/query-8284a5f2fb0c00c676f11b91457b8338692087d259f3c0dc0975b6b2053a7b45.json b/.sqlx/query-8284a5f2fb0c00c676f11b91457b8338692087d259f3c0dc0975b6b2053a7b45.json
deleted file mode 100644
index 42aa0d66c3..0000000000
--- a/.sqlx/query-8284a5f2fb0c00c676f11b91457b8338692087d259f3c0dc0975b6b2053a7b45.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH updated AS (\n UPDATE user_notification\n SET seen_at = NOW()\n WHERE user_id = $1 AND notification_id = ANY($2) AND deleted_at IS NULL\n RETURNING notification_id, done, seen_at::timestamptz as viewed_at\n )\n SELECT\n updated.notification_id,\n updated.done,\n updated.viewed_at,\n NOW()::timestamptz as \"updated_at!\"\n FROM updated\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "notification_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "done",
- "type_info": "Bool"
- },
- {
- "ordinal": 2,
- "name": "viewed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "updated_at!",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "UuidArray"
- ]
- },
- "nullable": [
- false,
- false,
- null,
- null
- ]
- },
- "hash": "8284a5f2fb0c00c676f11b91457b8338692087d259f3c0dc0975b6b2053a7b45"
-}
diff --git a/Cargo.lock b/Cargo.lock
index 88abf3dfb6..4d91e2ef3b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3025,6 +3025,7 @@ dependencies = [
"email",
"entity_access",
"entity_mutation",
+ "graphql_channel",
"graphql_common",
"graphql_email",
"graphql_entity_mutation",
@@ -6196,6 +6197,21 @@ dependencies = [
"workspace-hack",
]
+[[package]]
+name = "graphql_channel"
+version = "0.1.0"
+dependencies = [
+ "async-graphql",
+ "channels",
+ "chrono",
+ "entity_access",
+ "graphql_common",
+ "macro_user_id",
+ "tokio",
+ "uuid",
+ "workspace-hack",
+]
+
[[package]]
name = "graphql_common"
version = "0.1.0"
@@ -6268,6 +6284,7 @@ name = "graphql_notification"
version = "0.1.0"
dependencies = [
"async-graphql",
+ "chrono",
"graphql_common",
"macro_user_id",
"model-entity",
@@ -6275,6 +6292,7 @@ dependencies = [
"rootcause",
"serde_json",
"tokio",
+ "uuid",
"workspace-hack",
]
diff --git a/Cargo.toml b/Cargo.toml
index 0117574552..7ce8074dae 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,6 +22,7 @@ members = [
"crates/favorites",
"crates/foreign_entity",
"crates/generic_email_domains",
+ "crates/graphql_channel",
"crates/graphql_common",
"crates/graphql_email",
"crates/graphql_entity_mutation",
diff --git a/apps/web/src/lib/queries/channel/activity.ts b/apps/web/src/lib/queries/channel/activity.ts
index c7112f7804..92ec36cc93 100644
--- a/apps/web/src/lib/queries/channel/activity.ts
+++ b/apps/web/src/lib/queries/channel/activity.ts
@@ -4,6 +4,7 @@ import { type MutationCallbacks, withCallbacks } from '@queries/utils';
import { storageServiceClient } from '@service-storage/client';
import type { ActivityType } from '@service-storage/generated/schemas/activityType';
import type { ApiActivity as ChannelsActivity } from '@service-storage/generated/schemas/apiActivity';
+import { recordChannelActivity } from '@service-storage/graphql-channel-activity';
import { useMutation, useQuery } from '@tanstack/solid-query';
import { channelKeys } from './keys';
@@ -29,13 +30,7 @@ export function useUpdateChannelsActivityMutation(
return useMutation(() => ({
gcTime: 0,
mutationFn: async (vars: UpdateChannelActivityMutationVars) =>
- await throwOnErr(
- async () =>
- await storageServiceClient.postActivity({
- channel_id: vars.channelId,
- activity_type: vars.activityType,
- })
- ),
+ await recordChannelActivity(vars),
...withCallbacks<
ChannelsActivity,
Error,
diff --git a/apps/web/src/lib/queries/notification/tests/user-notifications.test.tsx b/apps/web/src/lib/queries/notification/tests/user-notifications.test.tsx
index c2da65ac36..eb7a5b14ae 100644
--- a/apps/web/src/lib/queries/notification/tests/user-notifications.test.tsx
+++ b/apps/web/src/lib/queries/notification/tests/user-notifications.test.tsx
@@ -1,4 +1,3 @@
-import { err, ok } from 'neverthrow';
/**
* @vitest-environment jsdom
*/
@@ -22,13 +21,15 @@ vi.mock('@service-notification/client', () => ({
notificationServiceClient: {
userNotifications: vi.fn(),
bulkGetUserNotificationsByEventItemId: vi.fn(),
- bulkMarkNotificationAsSeen: vi.fn(),
- bulkMarkNotificationAsDone: vi.fn(),
},
channelMentionMetadata: {},
documentMentionMetadata: {},
}));
+vi.mock('@service-storage/graphql-notifications', () => ({
+ updateNotifications: vi.fn(),
+}));
+
vi.mock('@queries/soup/normalized-cache', () => ({
optimisticUpdateSoupItemUpdatedAt: vi.fn(),
hasSoupEntity: vi.fn(() => false),
@@ -40,14 +41,9 @@ import {
optimisticUpdateSoupItemUpdatedAt,
refetchSoupEntity,
} from '@queries/soup/normalized-cache';
-import { notificationServiceClient } from '@service-notification/client';
+import { updateNotifications } from '@service-storage/graphql-notifications';
-const mockBulkMarkNotificationAsSeen = vi.mocked(
- notificationServiceClient.bulkMarkNotificationAsSeen
-);
-const mockBulkMarkNotificationAsDone = vi.mocked(
- notificationServiceClient.bulkMarkNotificationAsDone
-);
+const mockUpdateNotifications = vi.mocked(updateNotifications);
const mockOptimisticUpdateSoupItemUpdatedAt = vi.mocked(
optimisticUpdateSoupItemUpdatedAt
);
@@ -236,7 +232,7 @@ describe('notification mutations', () => {
const n2 = createMockNotification({ id: 'n2', viewed_at: null });
seedQueryCache([createMockNotificationPage([n1, n2])]);
- mockBulkMarkNotificationAsSeen.mockResolvedValue(ok({ success: true }));
+ mockUpdateNotifications.mockResolvedValue([]);
let mutatePromise: Promise<unknown> | undefined;
@@ -250,6 +246,10 @@ describe('notification mutations', () => {
await mutatePromise;
+ expect(mockUpdateNotifications).toHaveBeenCalledWith({
+ notificationIds: ['n1'],
+ operation: 'MARK_SEEN',
+ });
const notifications = getNotificationsFromCache();
expect(typeof notifications[0].viewed_at).toBe('string');
expect(notifications[1].viewed_at).toBe(null);
@@ -261,8 +261,8 @@ describe('notification mutations', () => {
const n1 = createMockNotification({ id: 'n1', viewed_at: null });
seedQueryCache([createMockNotificationPage([n1])]);
- mockBulkMarkNotificationAsSeen.mockResolvedValue(
- err([{ code: 'SERVER_ERROR', message: 'Failed to mark as seen' }])
+ mockUpdateNotifications.mockRejectedValue(
+ new Error('Failed to mark as seen')
);
let mutatePromise: Promise<unknown> | undefined;
@@ -295,7 +295,7 @@ describe('notification mutations', () => {
createMockNotificationPage([n2]),
]);
- mockBulkMarkNotificationAsSeen.mockResolvedValue(ok({ success: true }));
+ mockUpdateNotifications.mockResolvedValue([]);
let mutatePromise: Promise<unknown> | undefined;
@@ -324,7 +324,7 @@ describe('notification mutations', () => {
const n3 = createMockNotification({ id: 'n3' });
seedQueryCache([createMockNotificationPage([n1, n2, n3])]);
- mockBulkMarkNotificationAsDone.mockResolvedValue(ok({ success: true }));
+ mockUpdateNotifications.mockResolvedValue([]);
let mutatePromise: Promise<unknown> | undefined;
@@ -338,6 +338,10 @@ describe('notification mutations', () => {
await mutatePromise;
+ expect(mockUpdateNotifications).toHaveBeenCalledWith({
+ notificationIds: ['n1', 'n3'],
+ operation: 'MARK_DONE',
+ });
const notifications = getNotificationsFromCache();
expect(notifications).toHaveLength(1);
expect(notifications[0].id).toBe('n2');
@@ -350,9 +354,7 @@ describe('notification mutations', () => {
const n2 = createMockNotification({ id: 'n2' });
seedQueryCache([createMockNotificationPage([n1, n2])]);
- mockBulkMarkNotificationAsDone.mockResolvedValue(
- err([{ code: 'NETWORK_ERROR', message: 'Connection failed' }])
- );
+ mockUpdateNotifications.mockRejectedValue(new Error('Connection failed'));
let mutatePromise: Promise<unknown> | undefined;
@@ -386,7 +388,7 @@ describe('notification mutations', () => {
createMockNotificationPage([n3]),
]);
- mockBulkMarkNotificationAsDone.mockResolvedValue(ok({ success: true }));
+ mockUpdateNotifications.mockResolvedValue([]);
let mutatePromise: Promise<unknown> | undefined;
diff --git a/apps/web/src/lib/queries/notification/user-notifications.ts b/apps/web/src/lib/queries/notification/user-notifications.ts
index f6b31b4f90..f766ebbd0f 100644
--- a/apps/web/src/lib/queries/notification/user-notifications.ts
+++ b/apps/web/src/lib/queries/notification/user-notifications.ts
@@ -1,5 +1,5 @@
import type { Maybe } from '@core/types';
-import { type ResultError, throwOnErr } from '@core/util/result';
+import { throwOnErr } from '@core/util/result';
import type { UnifiedNotification } from '@notifications/types';
import {
hasSoupEntity,
@@ -11,13 +11,13 @@ import { type MutationCallbacks, withCallbacks } from '@queries/utils';
import { notificationServiceClient } from '@service-notification/client';
import type { ApiUserNotification } from '@service-notification/generated/schemas/apiUserNotification';
import type { GetAllUserNotificationsResponse } from '@service-notification/generated/schemas/getAllUserNotificationsResponse';
+import { updateNotifications } from '@service-storage/graphql-notifications';
import {
type InfiniteData,
type MutationFunction,
useInfiniteQuery,
useMutation,
} from '@tanstack/solid-query';
-import type { Result } from 'neverthrow';
import { match, P } from 'ts-pattern';
import { z } from 'zod';
import { queryClient } from '../client';
@@ -289,28 +289,18 @@ export function invalidateUserNotifications() {
});
}
-/** Plain-async wrapper around `bulkMarkNotificationAsDone`. Throws on failure. */
+/** Mark notifications done through the shared GraphQL mutation. Throws on failure. */
export async function bulkMarkNotificationsAsDone(
notificationIds: string[]
): Promise<void> {
- await throwOnErr(
- async () =>
- await notificationServiceClient.bulkMarkNotificationAsDone({
- notificationIds,
- })
- );
+ await updateNotifications({ notificationIds, operation: 'MARK_DONE' });
}
-/** Plain-async wrapper around `bulkMarkNotificationAsUndone`. Throws on failure. */
+/** Mark notifications undone through the shared GraphQL mutation. Throws on failure. */
export async function bulkMarkNotificationsAsUndone(
notificationIds: string[]
): Promise<void> {
- await throwOnErr(
- async () =>
- await notificationServiceClient.bulkMarkNotificationAsUndone({
- notificationIds,
- })
- );
+ await updateNotifications({ notificationIds, operation: 'MARK_UNDONE' });
}
/**
@@ -386,7 +376,7 @@ type NotificationsMutationCallbacks<T> = MutationCallbacks<
>;
type NotificationsMutationFn<T> = MutationFunction<
- Result<T, ResultError<string>[]>,
+ T,
NotificationsMutationParams
>;
@@ -440,8 +430,7 @@ function createNotificationsMutation<T>(
) {
return (callbacks?: NotificationsMutationCallbacks<T>) => {
return useMutation(() => ({
- mutationFn: async (params, ctx) =>
- await throwOnErr(async () => await mutationFn(params, ctx)),
+ mutationFn,
...withCallbacks<
T,
Error,
@@ -492,8 +481,9 @@ const mapNotificationsAsSeen = (
/** Marks notifications as seen with optimistic update. */
export const useMarkNotificationsAsSeenMutation = createNotificationsMutation(
async (params: NotificationsMutationParams) =>
- await notificationServiceClient.bulkMarkNotificationAsSeen({
+ await updateNotifications({
notificationIds: params.notificationIds,
+ operation: 'MARK_SEEN',
}),
{
onMutate: createNotificationsMutateFn(mapNotificationsAsSeen),
@@ -523,8 +513,9 @@ const markNotificationsAsDoneMutateFn = createNotificationsMutateFn(
/** Marks notifications as done (removes from list) with optimistic update. */
export const useMarkNotificationsAsDoneMutation = createNotificationsMutation(
async (params: NotificationsMutationParams) =>
- await notificationServiceClient.bulkMarkNotificationAsDone({
+ await updateNotifications({
notificationIds: params.notificationIds,
+ operation: 'MARK_DONE',
}),
{
onMutate: async (params) => {
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-activity-notifications.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql-activity-notifications.test.ts
new file mode 100644
index 0000000000..fea85c3dc1
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-activity-notifications.test.ts
@@ -0,0 +1,192 @@
+import { ok } from 'neverthrow';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import type { EntityData } from '../../../features/entity/types/entity';
+import type { WithNotification } from '../../../features/entity/types/notification';
+import { unreadFilterFn } from '../../../features/entity/utils/filter';
+import {
+ RecordChannelActivityDocument,
+ UpdateNotificationsDocument,
+} from './graphql/generated/graphql';
+import { recordChannelActivity } from './graphql-channel-activity';
+import { updateNotifications } from './graphql-notifications';
+
+const {
+ graphqlSoupEnabledMock,
+ markDoneMock,
+ markSeenMock,
+ markUndoneMock,
+ mutationMock,
+ postActivityMock,
+} = vi.hoisted(() => ({
+ graphqlSoupEnabledMock: vi.fn(() => true),
+ markDoneMock: vi.fn(),
+ markSeenMock: vi.fn(),
+ markUndoneMock: vi.fn(),
+ mutationMock: vi.fn(),
+ postActivityMock: vi.fn(),
+}));
+
+vi.mock('@core/constant/featureFlags', () => ({
+ ENABLE_GRAPHQL_SOUP: graphqlSoupEnabledMock,
+}));
+
+vi.mock('./client', () => ({
+ storageServiceClient: { postActivity: postActivityMock },
+}));
+
+vi.mock('../service-notification/client', () => ({
+ notificationServiceClient: {
+ bulkMarkNotificationAsDone: markDoneMock,
+ bulkMarkNotificationAsSeen: markSeenMock,
+ bulkMarkNotificationAsUndone: markUndoneMock,
+ },
+}));
+
+vi.mock('./graphql-soup', () => ({
+ getGraphqlSoupClient: () => ({ mutation: mutationMock }),
+}));
+
+describe('channel activity and notification GraphQL cache separation', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ graphqlSoupEnabledMock.mockReturnValue(true);
+ });
+
+ it('marks the linked notification seen while VIEW activity leaves unread state unchanged', async () => {
+ const notificationRecord = {
+ __typename: 'GraphqlSoupNotification' as const,
+ id: 'notification-1',
+ eventType: 'channel_message_send',
+ entityType: 'CHANNEL' as const,
+ entityId: 'channel-1',
+ sent: true,
+ done: false,
+ seen: false,
+ createdAt: '2025-01-01T00:00:00Z',
+ viewedAt: null as string | null,
+ updatedAt: '2025-01-01T00:00:00Z',
+ senderId: null,
+ metadata: { messageId: 'message-1' },
+ };
+ const channel = {
+ type: 'channel',
+ notifications: () => [
+ {
+ id: notificationRecord.id,
+ entity_type: 'channel',
+ entity_id: notificationRecord.entityId,
+ done: notificationRecord.done,
+ viewed_at: notificationRecord.viewedAt,
+ notification_event_type: notificationRecord.eventType,
+ notification_metadata: {
+ tag: notificationRecord.eventType,
+ content: notificationRecord.metadata,
+ },
+ },
+ ],
+ } as unknown as WithNotification<EntityData>;
+
+ mutationMock.mockImplementation((document) => ({
+ toPromise: async () => {
+ if (document === RecordChannelActivityDocument) {
+ return {
+ data: {
+ recordChannelActivity: {
+ __typename: 'GraphqlChannelActivity',
+ id: 'activity-1',
+ userId: 'macro|[email protected]',
+ channelId: 'channel-1',
+ createdAt: '2025-01-01T00:00:00Z',
+ updatedAt: '2025-01-01T00:00:01Z',
+ viewedAt: '2025-01-01T00:00:01Z',
+ interactedAt: null,
+ },
+ },
+ };
+ }
+ if (document === UpdateNotificationsDocument) {
+ const updated = {
+ ...notificationRecord,
+ seen: true,
+ viewedAt: '2025-01-01T00:00:02Z',
+ updatedAt: '2025-01-01T00:00:02Z',
+ };
+ // Model the normalized cache's __typename:id merge. The channel's
+ // notification edge keeps pointing at this same record.
+ Object.assign(notificationRecord, updated);
+ return { data: { updateNotifications: [updated] } };
+ }
+ throw new Error('unexpected GraphQL document');
+ },
+ }));
+
+ expect(unreadFilterFn(channel)).toBe(true);
+
+ await recordChannelActivity({
+ channelId: 'channel-1',
+ activityType: 'view',
+ });
+ expect(unreadFilterFn(channel)).toBe(true);
+
+ const updated = await updateNotifications({
+ notificationIds: ['notification-1'],
+ operation: 'MARK_SEEN',
+ });
+ expect(updated[0].__typename).toBe('GraphqlSoupNotification');
+ expect(updated[0].id).toBe('notification-1');
+ expect(unreadFilterFn(channel)).toBe(false);
+ });
+
+ it('uses only REST writes while GraphQL Soup is disabled', async () => {
+ graphqlSoupEnabledMock.mockReturnValue(false);
+ const activity = {
+ id: 'activity-1',
+ user_id: 'macro|[email protected]',
+ channel_id: 'channel-1',
+ created_at: '2025-01-01T00:00:00Z',
+ updated_at: '2025-01-01T00:00:01Z',
+ viewed_at: '2025-01-01T00:00:01Z',
+ interacted_at: undefined,
+ };
+ postActivityMock.mockResolvedValue(ok(activity));
+ markSeenMock.mockResolvedValue(ok({ success: true }));
+ markDoneMock.mockResolvedValue(ok({ success: true }));
+ markUndoneMock.mockResolvedValue(ok({ success: true }));
+
+ await expect(
+ recordChannelActivity({
+ channelId: 'channel-1',
+ activityType: 'view',
+ })
+ ).resolves.toEqual(activity);
+ await expect(
+ updateNotifications({
+ notificationIds: ['notification-1'],
+ operation: 'MARK_SEEN',
+ })
+ ).resolves.toEqual([]);
+ await updateNotifications({
+ notificationIds: ['notification-1'],
+ operation: 'MARK_DONE',
+ });
+ await updateNotifications({
+ notificationIds: ['notification-1'],
+ operation: 'MARK_UNDONE',
+ });
+
+ expect(postActivityMock).toHaveBeenCalledWith({
+ channel_id: 'channel-1',
+ activity_type: 'view',
+ });
+ expect(markSeenMock).toHaveBeenCalledWith({
+ notificationIds: ['notification-1'],
+ });
+ expect(markDoneMock).toHaveBeenCalledWith({
+ notificationIds: ['notification-1'],
+ });
+ expect(markUndoneMock).toHaveBeenCalledWith({
+ notificationIds: ['notification-1'],
+ });
+ expect(mutationMock).not.toHaveBeenCalled();
+ });
+});
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-channel-activity.ts b/apps/web/src/lib/service-clients/service-storage/graphql-channel-activity.ts
new file mode 100644
index 0000000000..07aaf02656
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-channel-activity.ts
@@ -0,0 +1,57 @@
+import { ENABLE_GRAPHQL_SOUP } from '@core/constant/featureFlags';
+import { throwOnErr } from '@core/util/result';
+import { storageServiceClient } from './client';
+import type { ActivityType } from './generated/schemas/activityType';
+import type { ApiActivity } from './generated/schemas/apiActivity';
+import {
+ type ChannelActivityType,
+ RecordChannelActivityDocument,
+ type RecordChannelActivityMutationVariables,
+} from './graphql/generated/graphql';
+import { getGraphqlSoupClient } from './graphql-soup';
+
+const ACTIVITY_TYPE_TO_GRAPHQL: Record<ActivityType, ChannelActivityType> = {
+ view: 'VIEW',
+ interact: 'INTERACT',
+};
+
+/** Record channel activity through the configured REST or GraphQL transport. */
+export async function recordChannelActivity(args: {
+ channelId: string;
+ activityType: ActivityType;
+}): Promise<ApiActivity> {
+ if (!ENABLE_GRAPHQL_SOUP()) {
+ return await throwOnErr(
+ async () =>
+ await storageServiceClient.postActivity({
+ channel_id: args.channelId,
+ activity_type: args.activityType,
+ })
+ );
+ }
+
+ const variables: RecordChannelActivityMutationVariables = {
+ input: {
+ channelId: args.channelId,
+ activityType: ACTIVITY_TYPE_TO_GRAPHQL[args.activityType],
+ },
+ };
+ const result = await getGraphqlSoupClient()
+ .mutation(RecordChannelActivityDocument, variables)
+ .toPromise();
+ if (result.error) throw result.error;
+ if (!result.data) {
+ throw new Error('recordChannelActivity mutation returned no data');
+ }
+
+ const activity = result.data.recordChannelActivity;
+ return {
+ id: activity.id,
+ user_id: activity.userId,
+ channel_id: activity.channelId,
+ created_at: activity.createdAt,
+ updated_at: activity.updatedAt,
+ viewed_at: activity.viewedAt ?? undefined,
+ interacted_at: activity.interactedAt ?? undefined,
+ };
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-notifications.ts b/apps/web/src/lib/service-clients/service-storage/graphql-notifications.ts
new file mode 100644
index 0000000000..9e8ab983d8
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-notifications.ts
@@ -0,0 +1,60 @@
+import { ENABLE_GRAPHQL_SOUP } from '@core/constant/featureFlags';
+import { throwOnErr } from '@core/util/result';
+import { notificationServiceClient } from '../service-notification/client';
+import {
+ type NotificationUpdateOperation,
+ UpdateNotificationsDocument,
+ type UpdateNotificationsMutation,
+ type UpdateNotificationsMutationVariables,
+} from './graphql/generated/graphql';
+import { getGraphqlSoupClient } from './graphql-soup';
+
+export type { NotificationUpdateOperation };
+
+/** Update user-owned notification statuses through the configured transport. */
+export async function updateNotifications(args: {
+ notificationIds: string[];
+ operation: NotificationUpdateOperation;
+}): Promise<UpdateNotificationsMutation['updateNotifications']> {
+ if (!ENABLE_GRAPHQL_SOUP()) {
+ const request = { notificationIds: args.notificationIds };
+ switch (args.operation) {
+ case 'MARK_SEEN':
+ await throwOnErr(
+ async () =>
+ await notificationServiceClient.bulkMarkNotificationAsSeen(request)
+ );
+ break;
+ case 'MARK_DONE':
+ await throwOnErr(
+ async () =>
+ await notificationServiceClient.bulkMarkNotificationAsDone(request)
+ );
+ break;
+ case 'MARK_UNDONE':
+ await throwOnErr(
+ async () =>
+ await notificationServiceClient.bulkMarkNotificationAsUndone(
+ request
+ )
+ );
+ break;
+ }
+ return [];
+ }
+
+ const variables: UpdateNotificationsMutationVariables = {
+ input: {
+ notificationIds: args.notificationIds,
+ operation: args.operation,
+ },
+ };
+ const result = await getGraphqlSoupClient()
+ .mutation(UpdateNotificationsDocument, variables)
+ .toPromise();
+ if (result.error) throw result.error;
+ if (!result.data) {
+ throw new Error('updateNotifications mutation returned no data');
+ }
+ return result.data.updateNotifications;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/channel-activity-notifications.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/channel-activity-notifications.graphql
new file mode 100644
index 0000000000..8074edd59f
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/channel-activity-notifications.graphql
@@ -0,0 +1,19 @@
+mutation RecordChannelActivity($input: RecordChannelActivityInput!) {
+ recordChannelActivity(input: $input) {
+ __typename
+ id
+ userId
+ channelId
+ createdAt
+ updatedAt
+ viewedAt
+ interactedAt
+ }
+}
+
+mutation UpdateNotifications($input: UpdateNotificationsInput!) {
+ updateNotifications(input: $input) {
+ __typename
+ ...SoupNotificationFields
+ }
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
index 4f052d90ba..60d6f19f0a 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
@@ -3,6 +3,13 @@ type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
/** Internal type. DO NOT USE DIRECTLY. */
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
+/** Channel activity operation exposed by GraphQL. */
+export type ChannelActivityType =
+ /** Record that the user interacted with the channel. */
+ | 'INTERACT'
+ /** Record that the user viewed the channel. */
+ | 'VIEW';
+
/** Channel-specific entry inside the otherwise common share-policy model. */
export type ChannelSharePolicyInput = {
/** Access level for add/replace operations. */
@@ -794,6 +801,23 @@ export type MoveEntityInput = {
projectId?: string | number | null | undefined;
};
+/** Explicit notification status operation exposed by GraphQL. */
+export type NotificationUpdateOperation =
+ /** Mark notifications as done. */
+ | 'MARK_DONE'
+ /** Mark notifications as seen. */
+ | 'MARK_SEEN'
+ /** Mark notifications as not done. */
+ | 'MARK_UNDONE';
+
+/** Input for recording authenticated channel activity. */
+export type RecordChannelActivityInput = {
+ /** Kind of activity to record. */
+ activityType: ChannelActivityType;
+ /** Channel receiving the activity update. */
+ channelId: string | number;
+};
+
/** One entity rename in a batch. */
export type RenameEntityInput = {
/** New user-visible display name. */
@@ -856,6 +880,28 @@ export type UpdateEntitySharePolicyInput = {
policy: EntitySharePolicyInput;
};
+/** Input for updating notification statuses. */
+export type UpdateNotificationsInput = {
+ /** User notification identifiers to update. */
+ notificationIds: Array<string | number>;
+ /** Status operation applied to every requested notification. */
+ operation: NotificationUpdateOperation;
+};
+
+export type RecordChannelActivityMutationVariables = Exact<{
+ input: RecordChannelActivityInput;
+}>;
+
+
+export type RecordChannelActivityMutation = { recordChannelActivity: { __typename: 'GraphqlChannelActivity', id: string, userId: string, channelId: string, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null } };
+
+export type UpdateNotificationsMutationVariables = Exact<{
+ input: UpdateNotificationsInput;
+}>;
+
+
+export type UpdateNotificationsMutation = { updateNotifications: Array<{ __typename: 'GraphqlSoupNotification', id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> };
+
type EntityMutationResultFields_GraphqlMutationError_Fragment = { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string };
type EntityMutationResultFields_GraphqlMutationSuccess_Fragment = { __typename: 'GraphqlMutationSuccess', effects: Array<
@@ -921,7 +967,7 @@ type EntityMutationResultFields_GraphqlMutationSuccess_Fragment = { __typename:
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> };
export type EntityMutationResultFieldsFragment =
@@ -994,7 +1040,7 @@ export type EntityMutationPayloadFieldsFragment = { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> };
@@ -1068,7 +1114,7 @@ export type RenameEntitiesMutation = { renameEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> } };
@@ -1142,7 +1188,7 @@ export type MoveEntitiesMutation = { moveEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> } };
@@ -1216,7 +1262,7 @@ export type UpdateEntitySharePoliciesMutation = { updateEntitySharePolicies: { r
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> } };
@@ -1290,7 +1336,7 @@ export type TrashEntitiesMutation = { trashEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> } };
@@ -1364,7 +1410,7 @@ export type RestoreEntitiesMutation = { restoreEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> } };
@@ -1438,7 +1484,7 @@ export type DeleteEntitiesPermanentlyMutation = { deleteEntitiesPermanently: { r
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> } };
@@ -1512,7 +1558,7 @@ export type DuplicateEntitiesMutation = { duplicateEntities: { results: Array<
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
> } };
@@ -1587,7 +1633,7 @@ export type SetEntityFavoriteMutation = { setEntityFavorite:
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- }
+ | null }
> }
};
@@ -1827,7 +1873,7 @@ type SoupPatchFields_SoupUpdated_Fragment = { __typename: 'SoupUpdated', item:
| { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null }>, notifications: Array<{ id: string, eventType: string, entityType: GraphqlSoupEntityType, entityId: string, sent: boolean, done: boolean, seen: boolean, createdAt: string, viewedAt: string | null, updatedAt: string, senderId: string | null, metadata: unknown }> }
- };
+ | null };
export type SoupPatchFieldsFragment =
| SoupPatchFields_GraphqlCacheDeletion_Fragment
@@ -2105,6 +2151,8 @@ export const SoupPatchFieldsFragmentDoc = {"kind":"Document","definitions":[{"ki
export const EntityMutationResultFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}}]} as unknown as DocumentNode<EntityMutationResultFieldsFragment, unknown>;
export const EntityMutationPayloadFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationPayloadFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EntityMutationPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationResultFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]} as unknown as DocumentNode<EntityMutationPayloadFieldsFragment, unknown>;
export const GraphqlHistoryItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GraphqlHistoryItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attachmentCount"}},{"kind":"Field","name":{"kind":"Name","value":"participantCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}}]} as unknown as DocumentNode<GraphqlHistoryItemFieldsFragment, unknown>;
+export const RecordChannelActivityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RecordChannelActivity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"RecordChannelActivityInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recordChannelActivity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}}]}}]}}]} as unknown as DocumentNode<RecordChannelActivityMutation, RecordChannelActivityMutationVariables>;
+export const UpdateNotificationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNotifications"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateNotificationsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}}]} as unknown as DocumentNode<UpdateNotificationsMutation, UpdateNotificationsMutationVariables>;
export const RenameEntitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RenameEntities"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"RenameEntityInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"renameEntities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputs"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationPayloadFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationPayloadFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EntityMutationPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationResultFields"}}]}}]}}]} as unknown as DocumentNode<RenameEntitiesMutation, RenameEntitiesMutationVariables>;
export const MoveEntitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MoveEntities"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MoveEntityInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"moveEntities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputs"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationPayloadFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationPayloadFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EntityMutationPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationResultFields"}}]}}]}}]} as unknown as DocumentNode<MoveEntitiesMutation, MoveEntitiesMutationVariables>;
export const UpdateEntitySharePoliciesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateEntitySharePolicies"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateEntitySharePolicyInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateEntitySharePolicies"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputs"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationPayloadFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationPayloadFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EntityMutationPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationResultFields"}}]}}]}}]} as unknown as DocumentNode<UpdateEntitySharePoliciesMutation, UpdateEntitySharePoliciesMutationVariables>;
diff --git a/crates/channels/Cargo.toml b/crates/channels/Cargo.toml
index e779424305..91f5d18f06 100644
--- a/crates/channels/Cargo.toml
+++ b/crates/channels/Cargo.toml
@@ -71,7 +71,7 @@ entity_mutation = [
"entity_access/ports",
"ports",
]
-ports = ["dep:tokio"]
+ports = ["dep:entity_access", "dep:tokio", "entity_access/ports"]
schema = ["channel_sender/schema", "dep:utoipa", "macro_user_id/schema"]
[dependencies]
diff --git a/crates/channels/src/domain/ports.rs b/crates/channels/src/domain/ports.rs
index 64c47fec6d..ced2f416e6 100644
--- a/crates/channels/src/domain/ports.rs
+++ b/crates/channels/src/domain/ports.rs
@@ -26,6 +26,7 @@ use crate::domain::side_effects::{
};
use channel_sender::ChannelSender;
use chrono::{DateTime, Utc};
+use entity_access::domain::models::{EntityAccessReceipt, MemberParticipantRole};
use macro_user_id::user_id::MacroUserIdStr;
use models_pagination::{CreatedAt, Query};
use std::collections::{HashMap, HashSet};
@@ -949,8 +950,7 @@ pub trait ChannelService: Send + Sync + 'static {
/// Upsert the user's activity (view/interaction) for a channel.
fn post_activity(
&self,
- _actor: Sender,
- _channel_id: Uuid,
+ _access: EntityAccessReceipt<MemberParticipantRole>,
_activity_type: ActivityType,
) -> impl Future<Output = Result<Activity, ChannelMutationErr>> + Send {
async move {
diff --git a/crates/channels/src/domain/service.rs b/crates/channels/src/domain/service.rs
index c0c5466af6..4e52703484 100644
--- a/crates/channels/src/domain/service.rs
+++ b/crates/channels/src/domain/service.rs
@@ -22,6 +22,7 @@ use crate::domain::{
use bot_id::BotIdStr;
use bot_id::cowlike::CowLike;
use channel_sender::ChannelSender;
+use entity_access::domain::models::{EntityAccessReceipt, EntityType, MemberParticipantRole};
use macro_user_id::user_id::MacroUserIdStr;
use models_pagination::{CreatedAt, PaginateOn, Query};
use std::collections::{HashMap, HashSet};
@@ -1627,10 +1628,20 @@ where
#[tracing::instrument(err, skip(self))]
async fn post_activity(
&self,
- actor: Sender,
- channel_id: Uuid,
+ access: EntityAccessReceipt<MemberParticipantRole>,
activity_type: ActivityType,
) -> Result<Activity, ChannelMutationErr> {
+ if access.entity().entity_type != EntityType::Channel {
+ return Err(ChannelMutationErr::BadRequest(
+ "channel access receipt required".to_string(),
+ ));
+ }
+ let channel_id = Uuid::parse_str(&access.entity().entity_id)
+ .map_err(|error| ChannelMutationErr::BadRequest(error.to_string()))?;
+ let actor = access.get_authenticated_user().map_err(|_| {
+ ChannelMutationErr::Unauthorized("authenticated user required".to_string())
+ })?;
+
let activity = self
.repo
.set_activity(actor.as_ref().to_string(), channel_id, activity_type)
diff --git a/crates/channels/src/inbound/axum_router.rs b/crates/channels/src/inbound/axum_router.rs
index 0b4784ffdf..dfd306d6a8 100644
--- a/crates/channels/src/inbound/axum_router.rs
+++ b/crates/channels/src/inbound/axum_router.rs
@@ -1754,13 +1754,19 @@ pub async fn post_activity_handler<
let user = &user.authorization.user;
let channel_id = Uuid::parse_str(&req.channel_id)
.map_err(|_| ChannelsHandlerErr::BadRequest("Invalid channel_id"))?;
+ let access = state
+ .access_service
+ .generate_entity_access_receipt::<MemberParticipantRole>(
+ &user.macro_user_id,
+ user.user_context.organization_id.map(i64::from),
+ &channel_id.to_string(),
+ EntityType::Channel,
+ )
+ .await
+ .map_err(map_access_error)?;
let activity = state
.service
- .post_activity(
- Sender::new_from_user(user.macro_user_id.clone()),
- channel_id,
- req.activity_type,
- )
+ .post_activity(access, req.activity_type)
.await?;
Ok((StatusCode::OK, Json(ApiActivity::from(activity))))
}
diff --git a/crates/channels/src/inbound/axum_router/test.rs b/crates/channels/src/inbound/axum_router/test.rs
index d667d0d1b0..bda6a86ed8 100644
--- a/crates/channels/src/inbound/axum_router/test.rs
+++ b/crates/channels/src/inbound/axum_router/test.rs
@@ -126,12 +126,26 @@ impl EntityAccessService for TestAccessService {
async fn generate_entity_access_receipt<T: RequiredPermission>(
&self,
- _user_id: &MacroUserId<Lowercase<'_>>,
+ user_id: &MacroUserId<Lowercase<'_>>,
_user_org_id: Option<i64>,
- _entity_id: &str,
- _entity_type: EntityType,
+ entity_id: &str,
+ entity_type: EntityType,
) -> Result<EntityAccessReceipt<T>, AccessError> {
- Err(self.access_err())
+ if !matches!(self.mode, AccessMode::Allow) {
+ return Err(self.access_err());
+ }
+ EntityAccessReceipt::try_new_authenticated_user(
+ MacroUserIdStr::parse_from_str(user_id.as_ref())
+ .unwrap()
+ .into_owned(),
+ Entity {
+ entity_id: entity_id.to_string(),
+ entity_type,
+ },
+ EntityPermission::ChannelRole {
+ role: EntityParticipantRole::Member,
+ },
+ )
}
async fn generate_bot_entity_access_receipt<T: RequiredPermission>(
@@ -2345,7 +2359,7 @@ async fn missing_channel_returns_404() {
#[derive(Default)]
struct ActivityService {
- posts: Arc<Mutex<Vec<(Sender, Uuid, ActivityType)>>>,
+ posts: Arc<Mutex<Vec<(String, Uuid, ActivityType)>>>,
}
impl ChannelService for ActivityService {
@@ -2436,17 +2450,18 @@ impl ChannelService for ActivityService {
async fn post_activity(
&self,
- actor: Sender,
- channel_id: Uuid,
+ access: EntityAccessReceipt<MemberParticipantRole>,
activity_type: ActivityType,
) -> Result<Activity, ChannelMutationErr> {
+ let actor = access.get_authenticated_user().unwrap().to_string();
+ let channel_id = Uuid::parse_str(&access.entity().entity_id).unwrap();
self.posts
.lock()
.unwrap()
.push((actor.clone(), channel_id, activity_type));
Ok(Activity {
id: Uuid::nil(),
- user_id: actor.as_ref().to_string(),
+ user_id: actor,
channel_id,
created_at: chrono::Utc::now(),
updated_at: chrono::Utc::now(),
@@ -2509,11 +2524,36 @@ async fn post_activity_records_and_returns_activity() {
let posts = posts.lock().unwrap();
assert_eq!(posts.len(), 1);
- assert_eq!(posts[0].0.as_ref(), "macro|[email protected]");
+ assert_eq!(posts[0].0, "macro|[email protected]");
assert_eq!(posts[0].1, channel_id);
assert!(matches!(posts[0].2, ActivityType::View));
}
+#[tokio::test]
+async fn post_activity_rejects_non_members() {
+ let router = channels_router(ChannelsRouterState::new(
+ ActivityService::default(),
+ TestAccessService::deny(),
+ authorization_state(),
+ ))
+ .layer(axum::middleware::map_request(attach_bearer));
+ let request = Request::builder()
+ .method("POST")
+ .uri("/activity")
+ .header("content-type", "application/json")
+ .body(axum::body::Body::from(
+ serde_json::json!({
+ "channel_id": Uuid::new_v4().to_string(),
+ "activity_type": "view"
+ })
+ .to_string(),
+ ))
+ .unwrap();
+
+ let res = router.oneshot(request).await.unwrap();
+ assert_eq!(res.status(), StatusCode::UNAUTHORIZED);
+}
+
#[tokio::test]
async fn post_activity_rejects_invalid_channel_id() {
let router = channels_router(ChannelsRouterState::new(
diff --git a/crates/client/cache-core/tests/engine.rs b/crates/client/cache-core/tests/engine.rs
index 216b2c03e8..7b5b9cdf62 100644
--- a/crates/client/cache-core/tests/engine.rs
+++ b/crates/client/cache-core/tests/engine.rs
@@ -22,6 +22,51 @@ query Soup($input: SoupInput!) {
}
"#;
+const CHANNEL_NOTIFICATIONS_QUERY: &str = r#"
+query ChannelNotifications($input: SoupInput!) {
+ user {
+ id
+ soup(input: $input) {
+ items {
+ __typename
+ id
+ ... on GraphqlSoupChannel {
+ notifications {
+ __typename
+ id
+ seen
+ viewedAt
+ }
+ }
+ }
+ nextCursor
+ }
+ }
+}
+"#;
+
+const RECORD_CHANNEL_ACTIVITY_MUTATION: &str = r#"
+mutation RecordChannelActivity($input: RecordChannelActivityInput!) {
+ recordChannelActivity(input: $input) {
+ __typename
+ id
+ channelId
+ viewedAt
+ }
+}
+"#;
+
+const UPDATE_NOTIFICATIONS_MUTATION: &str = r#"
+mutation UpdateNotifications($input: UpdateNotificationsInput!) {
+ updateNotifications(input: $input) {
+ __typename
+ id
+ seen
+ viewedAt
+ }
+}
+"#;
+
fn vars(limit: u64) -> serde_json::Map<String, Json> {
let Json::Object(map) = json!({ "input": { "limit": limit } }) else {
unreachable!()
@@ -161,6 +206,127 @@ fn cross_operation_invalidation() {
});
}
+#[test]
+fn channel_activity_and_notification_status_update_separate_normalized_records() {
+ block_on(async {
+ let mut engine = Engine::new(InMemoryStorage::new());
+ let query_variables = vars(10);
+ let initial = json!({
+ "user": {
+ "id": "user-1",
+ "soup": {
+ "items": [{
+ "__typename": "GraphqlSoupChannel",
+ "id": "channel-1",
+ "notifications": [{
+ "__typename": "GraphqlSoupNotification",
+ "id": "notification-1",
+ "seen": false,
+ "viewedAt": null
+ }]
+ }],
+ "nextCursor": null
+ }
+ }
+ });
+ engine
+ .write_query(
+ Some(1),
+ CHANNEL_NOTIFICATIONS_QUERY,
+ Some("ChannelNotifications"),
+ &query_variables,
+ &initial,
+ None,
+ )
+ .await
+ .unwrap();
+
+ let Json::Object(activity_variables) = json!({
+ "input": { "channelId": "channel-1", "activityType": "VIEW" }
+ }) else {
+ unreachable!()
+ };
+ engine
+ .write_query(
+ Some(2),
+ RECORD_CHANNEL_ACTIVITY_MUTATION,
+ Some("RecordChannelActivity"),
+ &activity_variables,
+ &json!({
+ "recordChannelActivity": {
+ "__typename": "GraphqlChannelActivity",
+ "id": "activity-1",
+ "channelId": "channel-1",
+ "viewedAt": "2025-01-01T00:00:01Z"
+ }
+ }),
+ None,
+ )
+ .await
+ .unwrap();
+
+ let ReadResult::Hit { data } = engine
+ .read_query(
+ Some(1),
+ CHANNEL_NOTIFICATIONS_QUERY,
+ Some("ChannelNotifications"),
+ &query_variables,
+ )
+ .await
+ .unwrap()
+ else {
+ panic!("expected cached channel after activity mutation");
+ };
+ assert_eq!(
+ data["user"]["soup"]["items"][0]["notifications"][0]["seen"],
+ json!(false)
+ );
+
+ let Json::Object(notification_variables) = json!({
+ "input": {
+ "notificationIds": ["notification-1"],
+ "operation": "MARK_SEEN"
+ }
+ }) else {
+ unreachable!()
+ };
+ engine
+ .write_query(
+ Some(3),
+ UPDATE_NOTIFICATIONS_MUTATION,
+ Some("UpdateNotifications"),
+ &notification_variables,
+ &json!({
+ "updateNotifications": [{
+ "__typename": "GraphqlSoupNotification",
+ "id": "notification-1",
+ "seen": true,
+ "viewedAt": "2025-01-01T00:00:02Z"
+ }]
+ }),
+ None,
+ )
+ .await
+ .unwrap();
+
+ let ReadResult::Hit { data } = engine
+ .read_query(
+ Some(1),
+ CHANNEL_NOTIFICATIONS_QUERY,
+ Some("ChannelNotifications"),
+ &query_variables,
+ )
+ .await
+ .unwrap()
+ else {
+ panic!("expected cached channel after notification mutation");
+ };
+ let notification = &data["user"]["soup"]["items"][0]["notifications"][0];
+ assert_eq!(notification["seen"], json!(true));
+ assert_eq!(notification["viewedAt"], json!("2025-01-01T00:00:02Z"));
+ });
+}
+
#[test]
fn hot_tier_eviction_falls_back_to_storage() {
block_on(async {
diff --git a/crates/complete_graph/Cargo.toml b/crates/complete_graph/Cargo.toml
index 2364d35c60..abbd0f82b2 100644
--- a/crates/complete_graph/Cargo.toml
+++ b/crates/complete_graph/Cargo.toml
@@ -17,6 +17,7 @@ entity_access = { path = "../entity_access", default-features = false, features
"inbound",
] }
entity_mutation = { path = "../entity_mutation" }
+graphql_channel = { path = "../graphql_channel" }
graphql_common = { path = "../graphql_common" }
graphql_email = { path = "../graphql_email" }
graphql_entity_mutation = { path = "../graphql_entity_mutation" }
diff --git a/crates/complete_graph/src/lib.rs b/crates/complete_graph/src/lib.rs
index cbbe1443c1..377081b11e 100644
--- a/crates/complete_graph/src/lib.rs
+++ b/crates/complete_graph/src/lib.rs
@@ -1,5 +1,5 @@
//! Composition of the domain GraphQL adapter crates (`graphql_soup`,
-//! `graphql_properties`, `graphql_notification`, `graphql_email`,
+//! `graphql_channel`, `graphql_properties`, `graphql_notification`, `graphql_email`,
//! `graphql_entity_mutation`) into the complete schema served by
//! `document_storage_service` and exported as SDL.
#![deny(missing_docs)]
@@ -13,6 +13,11 @@ mod schema;
mod sdl_test;
pub use edges::{SoupEdges, SoupEmailThreadEdges};
+pub use graphql_channel::{
+ ChannelActivityAuthorizer, ChannelActivityMutationService, ChannelMutationRoot,
+ GraphqlChannelActivity, GraphqlChannelActivityType, NoOpChannelActivityMutationService,
+ RecordChannelActivityInput,
+};
pub use graphql_common::GraphqlRequestParts;
pub use graphql_email::{
EmailContentKey, EmailContentLoad, EmailContentLoader, EmailServiceEmailContentReader,
@@ -29,7 +34,9 @@ pub use graphql_favorite::{
EntityFavoriteEdgeReader, EntityFavoriteLoader, entity_favorite_loader,
};
pub use graphql_notification::{
- EntityNotificationsLoader, SoupNotificationEdgeReader, entity_notifications_loader,
+ EntityNotificationsLoader, GraphqlNotificationUpdateOperation, NoOpNotificationMutationService,
+ NotificationMutationRoot, NotificationMutationService, SoupNotificationEdgeReader,
+ UpdateNotificationsInput, entity_notifications_loader,
};
pub use graphql_permission::{
EntityPermissionEdgeReader, EntityPermissionLoader, GraphqlAccessLevelPermission,
diff --git a/crates/complete_graph/src/schema.rs b/crates/complete_graph/src/schema.rs
index 653467da69..9a1b081159 100644
--- a/crates/complete_graph/src/schema.rs
+++ b/crates/complete_graph/src/schema.rs
@@ -11,11 +11,18 @@ use email::{
};
use entity_access::domain::ports::{EntityAccessService, NoOpEntityAccessService};
use entity_mutation::{EntityMutationService, UnavailableEntityMutationService};
+use graphql_channel::{
+ ChannelActivityAuthorizer, ChannelActivityMutationService, ChannelMutationRoot,
+ NoOpChannelActivityMutationService,
+};
use graphql_common::require_authorized_user;
use graphql_email::{NoOpSoupEmailContentEdgeReader, SoupEmailContentEdgeReader};
use graphql_entity_mutation::EntityMutationRoot;
use graphql_favorite::{EntityFavoriteEdgeReader, NoOpEntityFavoriteEdgeReader};
-use graphql_notification::{NoOpSoupNotificationEdgeReader, SoupNotificationEdgeReader};
+use graphql_notification::{
+ NoOpNotificationMutationService, NoOpSoupNotificationEdgeReader, NotificationMutationRoot,
+ NotificationMutationService, SoupNotificationEdgeReader,
+};
use graphql_permission::{EntityPermissionEdgeReader, NoOpEntityPermissionEdgeReader};
use graphql_properties::{
EntityPropertyReader, EntityPropertyWriter, NoOpEntityPropertyReader, NoOpEntityPropertyWriter,
@@ -37,23 +44,38 @@ use soup_realtime::domain::ports::{
use crate::SoupEdges;
-/// Mutation root combining property-specific and capability-oriented entity
-/// mutations without coupling either domain adapter to the other.
+/// Mutation root combining independent domain GraphQL adapters.
#[derive(MergedObject)]
pub struct CompleteMutationRoot<
W: EntityPropertyWriter,
M: EntityMutationService,
E: SoupEntityEdges,
->(PropertiesMutationRoot<W>, EntityMutationRoot<M, E>);
+ C: ChannelActivityMutationService,
+ N: NotificationMutationService,
+ A: ChannelActivityAuthorizer,
+>(
+ PropertiesMutationRoot<W>,
+ EntityMutationRoot<M, E>,
+ ChannelMutationRoot<C, A>,
+ NotificationMutationRoot<N>,
+);
-impl<W: EntityPropertyWriter, M: EntityMutationService, E: SoupEntityEdges>
- CompleteMutationRoot<W, M, E>
+impl<
+ W: EntityPropertyWriter,
+ M: EntityMutationService,
+ E: SoupEntityEdges,
+ C: ChannelActivityMutationService,
+ N: NotificationMutationService,
+ A: ChannelActivityAuthorizer,
+> CompleteMutationRoot<W, M, E, C, N, A>
{
/// Construct the composed mutation root.
fn new() -> Self {
Self(
PropertiesMutationRoot::<W>::new(),
EntityMutationRoot::<M, E>::new(),
+ ChannelMutationRoot::<C, A>::new(),
+ NotificationMutationRoot::<N>::new(),
)
}
}
@@ -63,18 +85,19 @@ impl<W: EntityPropertyWriter, M: EntityMutationService, E: SoupEntityEdges>
/// `S` is the soup query service, `R` the realtime subscription service, `E`
/// the email service, `EAS` the entity access service, `Auth` the authorization
/// service, `St` the embedding axum router state, `W` the property mutation
-/// writer, `M` the entity mutation service, `NR` the notification edge reader,
-/// `PR` the property edge reader, `ER` the email-content edge reader, `FR` the
-/// favorite edge reader, and `AR` the access edge reader.
-pub type SoupSchema<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR> = Schema<
+/// writer, `M` the entity mutation service, `C` the channel activity mutation
+/// service, `N` the notification mutation service, `NR` the notification edge
+/// reader, `PR` the property edge reader, `ER` the email-content edge reader,
+/// `FR` the favorite edge reader, and `AR` the access edge reader.
+pub type SoupSchema<S, R, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR> = Schema<
SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER, FR, AR>,
- CompleteMutationRoot<W, M, SoupEdges<NR, PR, ER, FR, AR>>,
+ CompleteMutationRoot<W, M, SoupEdges<NR, PR, ER, FR, AR>, C, N, EAS>,
SoupSubscriptionRoot<R, Auth, St, NR, PR, ER, FR, AR>,
>;
/// GraphQL Soup schema type backed by shared query and realtime services.
-pub type SharedSoupSchema<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR> =
- SoupSchema<Arc<S>, Arc<R>, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>;
+pub type SharedSoupSchema<S, R, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR> =
+ SoupSchema<Arc<S>, Arc<R>, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR>;
/// GraphQL Soup schema type backed by the no-op services, used only for
/// SDL export or introspection.
@@ -87,6 +110,8 @@ pub type SchemaOnlySoupSchema = SoupSchema<
SchemaOnlyState,
NoOpEntityPropertyWriter,
UnavailableEntityMutationService,
+ NoOpChannelActivityMutationService,
+ NoOpNotificationMutationService,
NoOpSoupNotificationEdgeReader,
NoOpEntityPropertyReader,
NoOpSoupEmailContentEdgeReader,
@@ -190,9 +215,25 @@ pub fn build_schema() -> SchemaOnlySoupSchema {
/// Build a GraphQL schema backed by a query service and no-op realtime service.
#[allow(clippy::type_complexity)]
-pub fn build_schema_with_service<S, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
+pub fn build_schema_with_service<S, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR>(
service: S,
-) -> SoupSchema<S, NoOpSoupRealtimeSubscriptionService, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>
+) -> SoupSchema<
+ S,
+ NoOpSoupRealtimeSubscriptionService,
+ E,
+ EAS,
+ Auth,
+ St,
+ W,
+ M,
+ C,
+ N,
+ NR,
+ PR,
+ ER,
+ FR,
+ AR,
+>
where
S: SoupService + Clone,
E: EmailService,
@@ -204,6 +245,8 @@ where
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
M: EntityMutationService,
+ C: ChannelActivityMutationService,
+ N: NotificationMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
@@ -215,10 +258,10 @@ where
/// Build a GraphQL schema backed by query and realtime Soup services.
#[allow(clippy::type_complexity)]
-pub fn build_schema_with_services<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
+pub fn build_schema_with_services<S, R, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR>(
service: S,
realtime_service: R,
-) -> SoupSchema<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>
+) -> SoupSchema<S, R, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR>
where
S: SoupService + Clone,
R: SoupRealtimeSubscriptionService + Clone,
@@ -231,6 +274,8 @@ where
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
M: EntityMutationService,
+ C: ChannelActivityMutationService,
+ N: NotificationMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
@@ -239,7 +284,7 @@ where
{
Schema::build(
SoupQueryRoot::new(service),
- CompleteMutationRoot::<W, M, SoupEdges<NR, PR, ER, FR, AR>>::new(),
+ CompleteMutationRoot::<W, M, SoupEdges<NR, PR, ER, FR, AR>, C, N, EAS>::new(),
SoupSubscriptionRoot::new(realtime_service),
)
.finish()
@@ -247,7 +292,7 @@ where
/// Build a GraphQL schema backed by an `Arc`-shared query service.
#[allow(clippy::type_complexity)]
-pub fn build_schema_from_arc<S, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
+pub fn build_schema_from_arc<S, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR>(
service: Arc<S>,
) -> SoupSchema<
Arc<S>,
@@ -258,6 +303,8 @@ pub fn build_schema_from_arc<S, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
St,
W,
M,
+ C,
+ N,
NR,
PR,
ER,
@@ -275,6 +322,8 @@ where
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
M: EntityMutationService,
+ C: ChannelActivityMutationService,
+ N: NotificationMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
@@ -286,10 +335,10 @@ where
/// Build a GraphQL schema backed by `Arc`-shared query and realtime services.
#[allow(clippy::type_complexity)]
-pub fn build_schema_from_arcs<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
+pub fn build_schema_from_arcs<S, R, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR>(
service: Arc<S>,
realtime_service: Arc<R>,
-) -> SharedSoupSchema<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>
+) -> SharedSoupSchema<S, R, E, EAS, Auth, St, W, M, C, N, NR, PR, ER, FR, AR>
where
S: SoupService,
R: SoupRealtimeSubscriptionService,
@@ -302,6 +351,8 @@ where
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
M: EntityMutationService,
+ C: ChannelActivityMutationService,
+ N: NotificationMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
diff --git a/crates/complete_graph/src/schema/test.rs b/crates/complete_graph/src/schema/test.rs
index ecfd79bd53..c35ee7a122 100644
--- a/crates/complete_graph/src/schema/test.rs
+++ b/crates/complete_graph/src/schema/test.rs
@@ -510,6 +510,8 @@ struct TestHarness {
TestState,
NoOpEntityPropertyWriter,
UnavailableEntityMutationService,
+ NoOpChannelActivityMutationService,
+ NoOpNotificationMutationService,
NoOpSoupNotificationEdgeReader,
NoOpEntityPropertyReader,
NoOpSoupEmailContentEdgeReader,
@@ -621,6 +623,8 @@ async fn soup_updates_subscribes_as_the_authenticated_user() {
SchemaOnlyState,
NoOpEntityPropertyWriter,
UnavailableEntityMutationService,
+ NoOpChannelActivityMutationService,
+ NoOpNotificationMutationService,
NoOpSoupNotificationEdgeReader,
NoOpEntityPropertyReader,
NoOpSoupEmailContentEdgeReader,
diff --git a/crates/complete_graph/src/sdl_test.rs b/crates/complete_graph/src/sdl_test.rs
index 607b4731ac..dee08019c3 100644
--- a/crates/complete_graph/src/sdl_test.rs
+++ b/crates/complete_graph/src/sdl_test.rs
@@ -43,6 +43,13 @@ fn soup_response_schema_exposes_frontend_fields() {
"union SoupPatch = SoupUpdated | GraphqlCacheDeletion",
"type GraphqlMutationSuccess {",
"effects: [SoupPatch!]!",
+ "recordChannelActivity(input: RecordChannelActivityInput!): GraphqlChannelActivity!",
+ "updateNotifications(input: UpdateNotificationsInput!): [GraphqlSoupNotification!]!",
+ "enum ChannelActivityType {",
+ "enum NotificationUpdateOperation {",
+ "MARK_SEEN",
+ "MARK_DONE",
+ "MARK_UNDONE",
"type SoupSubscriptionRoot {",
"soupUpdates: [SoupPatch!]!",
] {
diff --git a/crates/graphql_channel/Cargo.toml b/crates/graphql_channel/Cargo.toml
new file mode 100644
index 0000000000..64281538cf
--- /dev/null
+++ b/crates/graphql_channel/Cargo.toml
@@ -0,0 +1,18 @@
+[package]
+name = "graphql_channel"
+version = "0.1.0"
+edition = "2024"
+publish = false
+
+[dependencies]
+async-graphql = { workspace = true }
+channels = { path = "../channels", default-features = false, features = ["ports"] }
+entity_access = { path = "../entity_access", default-features = false, features = ["ports"] }
+graphql_common = { path = "../graphql_common" }
+macro_user_id = { path = "../macro_user_id" }
+uuid = { workspace = true }
+workspace-hack = { version = "0.1", path = "../workspace-hack" }
+
+[dev-dependencies]
+chrono = { workspace = true }
+tokio = { workspace = true, features = ["macros", "rt"] }
diff --git a/crates/graphql_channel/src/lib.rs b/crates/graphql_channel/src/lib.rs
new file mode 100644
index 0000000000..144617d1e8
--- /dev/null
+++ b/crates/graphql_channel/src/lib.rs
@@ -0,0 +1,205 @@
+//! GraphQL inbound mutation adapter for channel activity.
+#![deny(missing_docs)]
+#![deny(clippy::missing_docs_in_private_items)]
+
+#[cfg(test)]
+mod test;
+
+use std::{marker::PhantomData, sync::Arc};
+
+use async_graphql::{Context, Enum, ID, InputObject, Object};
+use channels::domain::{
+ models::{Activity, ActivityType},
+ ports::{ChannelMutationErr, ChannelService},
+};
+use entity_access::domain::{
+ models::{AccessError, EntityAccessReceipt, EntityType, MemberParticipantRole},
+ ports::EntityAccessService,
+};
+use graphql_common::{parse_id, require_authenticated_user};
+use macro_user_id::user_id::MacroUserIdStr;
+use uuid::Uuid;
+
+/// Domain-facing capability required by the channel activity mutation.
+pub trait ChannelActivityMutationService: Send + Sync + 'static {
+ /// Record activity after channel member access has been verified.
+ fn record_channel_activity(
+ &self,
+ access: EntityAccessReceipt<MemberParticipantRole>,
+ activity_type: ActivityType,
+ ) -> impl Future<Output = Result<Activity, ChannelMutationErr>> + Send;
+}
+
+impl<S> ChannelActivityMutationService for S
+where
+ S: ChannelService,
+{
+ fn record_channel_activity(
+ &self,
+ access: EntityAccessReceipt<MemberParticipantRole>,
+ activity_type: ActivityType,
+ ) -> impl Future<Output = Result<Activity, ChannelMutationErr>> + Send {
+ self.post_activity(access, activity_type)
+ }
+}
+
+/// Typed channel-member authorization boundary used by the GraphQL adapter.
+pub trait ChannelActivityAuthorizer: Send + Sync + 'static {
+ /// Mint a member receipt for the authenticated user and channel.
+ fn authorize_channel_member(
+ &self,
+ user_id: &MacroUserIdStr<'static>,
+ channel_id: Uuid,
+ ) -> impl Future<Output = Result<EntityAccessReceipt<MemberParticipantRole>, AccessError>> + Send;
+}
+
+impl<A> ChannelActivityAuthorizer for A
+where
+ A: EntityAccessService,
+{
+ async fn authorize_channel_member(
+ &self,
+ user_id: &MacroUserIdStr<'static>,
+ channel_id: Uuid,
+ ) -> Result<EntityAccessReceipt<MemberParticipantRole>, AccessError> {
+ self.generate_entity_access_receipt::<MemberParticipantRole>(
+ user_id,
+ None,
+ &channel_id.to_string(),
+ EntityType::Channel,
+ )
+ .await
+ }
+}
+
+/// Schema-only channel activity service.
+#[derive(Clone, Copy, Debug, Default)]
+pub struct NoOpChannelActivityMutationService;
+
+impl ChannelActivityMutationService for NoOpChannelActivityMutationService {
+ async fn record_channel_activity(
+ &self,
+ _access: EntityAccessReceipt<MemberParticipantRole>,
+ _activity_type: ActivityType,
+ ) -> Result<Activity, ChannelMutationErr> {
+ Err(ChannelMutationErr::NotFound(
+ "channel activity mutations are not configured".to_string(),
+ ))
+ }
+}
+
+/// Root GraphQL adapter for channel mutations.
+pub struct ChannelMutationRoot<S, A>(PhantomData<fn() -> (S, A)>);
+
+impl<S, A> ChannelMutationRoot<S, A> {
+ /// Construct a channel mutation root.
+ pub fn new() -> Self {
+ Self(PhantomData)
+ }
+}
+
+impl<S, A> Default for ChannelMutationRoot<S, A> {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+/// Channel activity operation exposed by GraphQL.
+#[derive(Clone, Copy, Debug, Eq, Enum, PartialEq)]
+#[graphql(name = "ChannelActivityType")]
+pub enum GraphqlChannelActivityType {
+ /// Record that the user viewed the channel.
+ View,
+ /// Record that the user interacted with the channel.
+ Interact,
+}
+
+impl From<GraphqlChannelActivityType> for ActivityType {
+ fn from(value: GraphqlChannelActivityType) -> Self {
+ match value {
+ GraphqlChannelActivityType::View => Self::View,
+ GraphqlChannelActivityType::Interact => Self::Interact,
+ }
+ }
+}
+
+/// Input for recording authenticated channel activity.
+#[derive(InputObject)]
+pub struct RecordChannelActivityInput {
+ /// Channel receiving the activity update.
+ pub channel_id: ID,
+ /// Kind of activity to record.
+ pub activity_type: GraphqlChannelActivityType,
+}
+
+/// Authoritative channel activity returned by the channels domain.
+pub struct GraphqlChannelActivity(Activity);
+
+/// GraphQL fields for authoritative channel activity.
+#[Object]
+impl GraphqlChannelActivity {
+ /// Stable activity row identifier.
+ async fn id(&self) -> ID {
+ ID(self.0.id.to_string())
+ }
+
+ /// User who owns this activity row.
+ async fn user_id(&self) -> &str {
+ &self.0.user_id
+ }
+
+ /// Channel associated with the activity.
+ async fn channel_id(&self) -> ID {
+ ID(self.0.channel_id.to_string())
+ }
+
+ /// Activity row creation time in RFC 3339 format.
+ async fn created_at(&self) -> String {
+ self.0.created_at.to_rfc3339()
+ }
+
+ /// Activity row update time in RFC 3339 format.
+ async fn updated_at(&self) -> String {
+ self.0.updated_at.to_rfc3339()
+ }
+
+ /// Most recent channel view time in RFC 3339 format.
+ async fn viewed_at(&self) -> Option<String> {
+ self.0.viewed_at.map(|value| value.to_rfc3339())
+ }
+
+ /// Most recent channel interaction time in RFC 3339 format.
+ async fn interacted_at(&self) -> Option<String> {
+ self.0.interacted_at.map(|value| value.to_rfc3339())
+ }
+}
+
+/// GraphQL channel mutations.
+#[Object]
+impl<S, A> ChannelMutationRoot<S, A>
+where
+ S: ChannelActivityMutationService,
+ A: ChannelActivityAuthorizer,
+{
+ /// Record a view or interaction in the authenticated user's channel activity.
+ async fn record_channel_activity(
+ &self,
+ ctx: &Context<'_>,
+ input: RecordChannelActivityInput,
+ ) -> async_graphql::Result<GraphqlChannelActivity> {
+ let user_id = require_authenticated_user(ctx)?;
+ let channel_id = parse_id(input.channel_id, "channelId")?;
+ let authorizer = ctx.data::<Arc<A>>()?;
+ let access = authorizer
+ .authorize_channel_member(&user_id, channel_id)
+ .await
+ .map_err(|error| async_graphql::Error::new(error.to_string()))?;
+ let service = ctx.data::<Arc<S>>()?;
+ let activity = service
+ .record_channel_activity(access, input.activity_type.into())
+ .await
+ .map_err(|error| async_graphql::Error::new(error.to_string()))?;
+
+ Ok(GraphqlChannelActivity(activity))
+ }
+}
diff --git a/crates/graphql_channel/src/test.rs b/crates/graphql_channel/src/test.rs
new file mode 100644
index 0000000000..d406e7e26f
--- /dev/null
+++ b/crates/graphql_channel/src/test.rs
@@ -0,0 +1,120 @@
+use std::sync::{Arc, Mutex};
+
+use async_graphql::{EmptySubscription, Object, Schema};
+use channels::domain::models::{Activity, ActivityType};
+use entity_access::domain::models::{
+ AccessError, Entity, EntityAccessAuth, EntityAccessReceipt, EntityPermission, EntityType,
+ MemberParticipantRole, ParticipantRole,
+};
+use macro_user_id::user_id::MacroUserIdStr;
+use uuid::Uuid;
+
+use super::*;
+
+struct QueryRoot;
+
+#[Object]
+impl QueryRoot {
+ async fn health(&self) -> bool {
+ true
+ }
+}
+
+#[derive(Default)]
+struct CapturingService {
+ calls: Mutex<Vec<(String, Uuid, ActivityType)>>,
+}
+
+impl ChannelActivityMutationService for CapturingService {
+ async fn record_channel_activity(
+ &self,
+ access: EntityAccessReceipt<MemberParticipantRole>,
+ activity_type: ActivityType,
+ ) -> Result<Activity, ChannelMutationErr> {
+ let user_id = access.get_authenticated_user().unwrap().to_string();
+ let channel_id = Uuid::parse_str(&access.entity().entity_id).unwrap();
+ self.calls
+ .lock()
+ .unwrap()
+ .push((user_id.clone(), channel_id, activity_type));
+ let now = chrono::Utc::now();
+ Ok(Activity {
+ id: Uuid::new_v4(),
+ user_id,
+ channel_id,
+ created_at: now,
+ updated_at: now,
+ viewed_at: Some(now),
+ interacted_at: None,
+ })
+ }
+}
+
+#[derive(Default)]
+struct MemberAuthorizer {
+ calls: Mutex<Vec<(String, Uuid)>>,
+}
+
+impl ChannelActivityAuthorizer for MemberAuthorizer {
+ async fn authorize_channel_member(
+ &self,
+ user_id: &MacroUserIdStr<'static>,
+ channel_id: Uuid,
+ ) -> Result<EntityAccessReceipt<MemberParticipantRole>, AccessError> {
+ self.calls
+ .lock()
+ .unwrap()
+ .push((user_id.to_string(), channel_id));
+ EntityAccessReceipt::try_new(
+ EntityAccessAuth::Authenticated(user_id.clone()),
+ Entity {
+ entity_id: channel_id.to_string(),
+ entity_type: EntityType::Channel,
+ },
+ EntityPermission::ChannelRole {
+ role: ParticipantRole::Member,
+ },
+ )
+ }
+}
+
+#[tokio::test]
+async fn record_channel_activity_authorizes_and_delegates_only_channel_activity() {
+ let service = Arc::new(CapturingService::default());
+ let authorizer = Arc::new(MemberAuthorizer::default());
+ let user = MacroUserIdStr::try_from_email("[email protected]").unwrap();
+ let channel_id = Uuid::new_v4();
+ let schema = Schema::build(
+ QueryRoot,
+ ChannelMutationRoot::<CapturingService, MemberAuthorizer>::new(),
+ EmptySubscription,
+ )
+ .data(service.clone())
+ .data(authorizer.clone())
+ .data(user)
+ .finish();
+
+ let response = schema
+ .execute(format!(
+ r#"mutation {{ recordChannelActivity(input: {{ channelId: "{channel_id}", activityType: VIEW }}) {{ id channelId userId viewedAt interactedAt }} }}"#
+ ))
+ .await;
+
+ assert!(response.errors.is_empty(), "{:?}", response.errors);
+ let data = response.data.into_json().unwrap();
+ assert_eq!(
+ data["recordChannelActivity"]["channelId"],
+ channel_id.to_string()
+ );
+ assert!(data["recordChannelActivity"]["viewedAt"].is_string());
+ assert!(data["recordChannelActivity"]["interactedAt"].is_null());
+ assert_eq!(authorizer.calls.lock().unwrap().len(), 1);
+ assert_eq!(
+ service.calls.lock().unwrap().as_slice(),
+ [(
+ "macro|[email protected]".to_string(),
+ channel_id,
+ ActivityType::View,
+ ),]
+ );
+}
diff --git a/crates/graphql_common/src/authorization.rs b/crates/graphql_common/src/authorization.rs
index 4f2a6cdcd6..8e62ff915c 100644
--- a/crates/graphql_common/src/authorization.rs
+++ b/crates/graphql_common/src/authorization.rs
@@ -12,6 +12,16 @@ use macro_user_id::user_id::MacroUserIdStr;
use crate::extract_part;
+/// Require the authenticated user inserted into the GraphQL request context
+/// by the mounting inbound HTTP adapter.
+pub fn require_authenticated_user(
+ ctx: &Context<'_>,
+) -> async_graphql::Result<MacroUserIdStr<'static>> {
+ ctx.data_opt::<MacroUserIdStr<'static>>()
+ .cloned()
+ .ok_or_else(|| async_graphql::Error::new("authentication required"))
+}
+
/// Extract the authorized caller (reusing the `Cached` entry primed by the
/// mounting HTTP handler) and require an authenticated user.
pub async fn require_authorized_user<Auth, St>(
diff --git a/crates/graphql_common/src/lib.rs b/crates/graphql_common/src/lib.rs
index 4060c83622..a310a540e9 100644
--- a/crates/graphql_common/src/lib.rs
+++ b/crates/graphql_common/src/lib.rs
@@ -20,7 +20,7 @@ mod property_filter;
/// Request-scoped context used by GraphQL resolvers.
mod request_context;
-pub use authorization::require_authorized_user;
+pub use authorization::{require_authenticated_user, require_authorized_user};
pub use entity_type::{
GraphqlCacheDeletion, GraphqlEntity, GraphqlEntityType, GraphqlSoupEntityType,
};
diff --git a/crates/graphql_notification/Cargo.toml b/crates/graphql_notification/Cargo.toml
index 12b8eaa671..a4383a01f9 100644
--- a/crates/graphql_notification/Cargo.toml
+++ b/crates/graphql_notification/Cargo.toml
@@ -13,4 +13,8 @@ notification = { path = "../notification" }
rootcause = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
+uuid = { workspace = true }
workspace-hack = { version = "0.1", path = "../workspace-hack" }
+
+[dev-dependencies]
+chrono = { workspace = true }
diff --git a/crates/graphql_notification/src/lib.rs b/crates/graphql_notification/src/lib.rs
index 1c89cadd4a..1cbfcaf302 100644
--- a/crates/graphql_notification/src/lib.rs
+++ b/crates/graphql_notification/src/lib.rs
@@ -5,6 +5,8 @@
/// DataLoader implementations for notification edges.
mod loaders;
+/// GraphQL notification mutation adapter.
+mod mutations;
/// GraphQL notification object and edge resolver.
mod objects;
@@ -12,4 +14,8 @@ pub use loaders::{
EntityNotificationsLoader, NoOpSoupNotificationEdgeReader, SoupNotificationEdgeReader,
entity_notifications_loader,
};
+pub use mutations::{
+ GraphqlNotificationUpdateOperation, NoOpNotificationMutationService, NotificationMutationRoot,
+ NotificationMutationService, UpdateNotificationsInput,
+};
pub use objects::{GraphqlSoupNotification, load_entity_notifications};
diff --git a/crates/graphql_notification/src/mutations.rs b/crates/graphql_notification/src/mutations.rs
new file mode 100644
index 0000000000..db67179f85
--- /dev/null
+++ b/crates/graphql_notification/src/mutations.rs
@@ -0,0 +1,146 @@
+use std::{marker::PhantomData, sync::Arc};
+
+use async_graphql::{Context, Enum, ID, InputObject, Object};
+use graphql_common::{parse_id, require_authenticated_user};
+use macro_user_id::user_id::MacroUserIdStr;
+use notification::domain::{
+ models::{UserNotificationRow, request::NotificationStatus},
+ service::NotificationReader,
+};
+use rootcause::Report;
+use uuid::Uuid;
+
+use crate::objects::GraphqlSoupNotification;
+
+#[cfg(test)]
+mod test;
+
+/// Domain-facing capability required by notification status mutations.
+pub trait NotificationMutationService: Send + Sync + 'static {
+ /// Update user-owned notifications and return their authoritative active rows.
+ fn update_notifications(
+ &self,
+ user_id: MacroUserIdStr<'static>,
+ notification_ids: Vec<Uuid>,
+ status: NotificationStatus,
+ ) -> impl Future<Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>> + Send;
+}
+
+impl<S> NotificationMutationService for S
+where
+ S: NotificationReader,
+{
+ async fn update_notifications(
+ &self,
+ user_id: MacroUserIdStr<'static>,
+ notification_ids: Vec<Uuid>,
+ status: NotificationStatus,
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
+ self.update_notifications_and_return(
+ notification::domain::models::request::UpdateNotificationsRequest {
+ user_id,
+ notification_ids: &notification_ids,
+ status,
+ },
+ )
+ .await
+ }
+}
+
+/// Schema-only notification mutation service.
+#[derive(Clone, Copy, Debug, Default)]
+pub struct NoOpNotificationMutationService;
+
+impl NotificationMutationService for NoOpNotificationMutationService {
+ async fn update_notifications(
+ &self,
+ _user_id: MacroUserIdStr<'static>,
+ _notification_ids: Vec<Uuid>,
+ _status: NotificationStatus,
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
+ Err(rootcause::report!(
+ "notification mutations are not configured"
+ ))
+ }
+}
+
+/// Root GraphQL adapter for notification mutations.
+pub struct NotificationMutationRoot<S>(PhantomData<S>);
+
+impl<S> NotificationMutationRoot<S> {
+ /// Construct a notification mutation root.
+ pub fn new() -> Self {
+ Self(PhantomData)
+ }
+}
+
+impl<S> Default for NotificationMutationRoot<S> {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+/// Explicit notification status operation exposed by GraphQL.
+#[derive(Clone, Copy, Debug, Enum, Eq, PartialEq)]
+#[graphql(name = "NotificationUpdateOperation")]
+pub enum GraphqlNotificationUpdateOperation {
+ /// Mark notifications as seen.
+ #[graphql(name = "MARK_SEEN")]
+ MarkSeen,
+ /// Mark notifications as done.
+ #[graphql(name = "MARK_DONE")]
+ MarkDone,
+ /// Mark notifications as not done.
+ #[graphql(name = "MARK_UNDONE")]
+ MarkUndone,
+}
+
+impl From<GraphqlNotificationUpdateOperation> for NotificationStatus {
+ fn from(value: GraphqlNotificationUpdateOperation) -> Self {
+ match value {
+ GraphqlNotificationUpdateOperation::MarkSeen => Self::Seen,
+ GraphqlNotificationUpdateOperation::MarkDone => Self::Done(true),
+ GraphqlNotificationUpdateOperation::MarkUndone => Self::Done(false),
+ }
+ }
+}
+
+/// Input for updating notification statuses.
+#[derive(InputObject)]
+pub struct UpdateNotificationsInput {
+ /// User notification identifiers to update.
+ pub notification_ids: Vec<ID>,
+ /// Status operation applied to every requested notification.
+ pub operation: GraphqlNotificationUpdateOperation,
+}
+
+/// GraphQL notification mutations.
+#[Object]
+impl<S> NotificationMutationRoot<S>
+where
+ S: NotificationMutationService,
+{
+ /// Update authenticated user-owned notifications and return authoritative rows.
+ async fn update_notifications(
+ &self,
+ ctx: &Context<'_>,
+ input: UpdateNotificationsInput,
+ ) -> async_graphql::Result<Vec<GraphqlSoupNotification>> {
+ let user_id = require_authenticated_user(ctx)?;
+ let notification_ids = input
+ .notification_ids
+ .into_iter()
+ .map(|id| parse_id(id, "notificationIds"))
+ .collect::<async_graphql::Result<Vec<_>>>()?;
+ let service = ctx.data::<Arc<S>>()?;
+ let notifications = service
+ .update_notifications(user_id, notification_ids, input.operation.into())
+ .await
+ .map_err(|error| async_graphql::Error::new(error.to_string()))?;
+
+ Ok(notifications
+ .into_iter()
+ .map(GraphqlSoupNotification::from)
+ .collect())
+ }
+}
diff --git a/crates/graphql_notification/src/mutations/test.rs b/crates/graphql_notification/src/mutations/test.rs
new file mode 100644
index 0000000000..e0712ab904
--- /dev/null
+++ b/crates/graphql_notification/src/mutations/test.rs
@@ -0,0 +1,115 @@
+use std::sync::{Arc, Mutex};
+
+use async_graphql::{EmptySubscription, Object, Schema};
+use chrono::Utc;
+use model_entity::EntityType;
+use notification::domain::models::request::NotificationStatus;
+use serde_json::json;
+
+use super::*;
+
+struct QueryRoot;
+
+#[Object]
+impl QueryRoot {
+ async fn health(&self) -> bool {
+ true
+ }
+}
+
+#[derive(Default)]
+struct CapturingNotificationService {
+ calls: Mutex<Vec<(String, Vec<Uuid>, &'static str)>>,
+}
+
+impl NotificationMutationService for CapturingNotificationService {
+ async fn update_notifications(
+ &self,
+ user_id: MacroUserIdStr<'static>,
+ notification_ids: Vec<Uuid>,
+ status: NotificationStatus,
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
+ let operation = match status {
+ NotificationStatus::Seen => "seen",
+ NotificationStatus::Done(true) => "done",
+ NotificationStatus::Done(false) => "undone",
+ };
+ self.calls
+ .lock()
+ .unwrap()
+ .push((user_id.to_string(), notification_ids.clone(), operation));
+ let now = Utc::now();
+ Ok(notification_ids
+ .into_iter()
+ .map(|notification_id| UserNotificationRow {
+ owner_id: user_id.clone(),
+ notification_id,
+ notification_event_type: "channel_message_send".to_string(),
+ entity: EntityType::Channel.with_entity_string("channel-1".to_string()),
+ sent: true,
+ done: false,
+ created_at: now,
+ viewed_at: Some(now),
+ updated_at: now,
+ deleted_at: None,
+ notification_metadata: json!({ "messageId": "message-1" }),
+ sender_id: None,
+ })
+ .collect())
+ }
+}
+
+#[test]
+fn notification_operations_map_to_explicit_domain_statuses() {
+ assert!(matches!(
+ NotificationStatus::from(GraphqlNotificationUpdateOperation::MarkSeen),
+ NotificationStatus::Seen
+ ));
+ assert!(matches!(
+ NotificationStatus::from(GraphqlNotificationUpdateOperation::MarkDone),
+ NotificationStatus::Done(true)
+ ));
+ assert!(matches!(
+ NotificationStatus::from(GraphqlNotificationUpdateOperation::MarkUndone),
+ NotificationStatus::Done(false)
+ ));
+}
+
+#[tokio::test]
+async fn update_notifications_maps_operation_and_returns_normalized_rows_in_order() {
+ let service = Arc::new(CapturingNotificationService::default());
+ let user = MacroUserIdStr::try_from_email("[email protected]").unwrap();
+ let first = Uuid::new_v4();
+ let second = Uuid::new_v4();
+ let schema = Schema::build(
+ QueryRoot,
+ NotificationMutationRoot::<CapturingNotificationService>::new(),
+ EmptySubscription,
+ )
+ .data(service.clone())
+ .data(user)
+ .finish();
+
+ let response = schema
+ .execute(format!(
+ r#"mutation {{ updateNotifications(input: {{ notificationIds: ["{second}", "{first}"], operation: MARK_SEEN }}) {{ __typename id seen viewedAt }} }}"#
+ ))
+ .await;
+
+ assert!(response.errors.is_empty(), "{:?}", response.errors);
+ let data = response.data.into_json().unwrap();
+ assert_eq!(
+ data["updateNotifications"][0]["__typename"],
+ "GraphqlSoupNotification"
+ );
+ assert_eq!(data["updateNotifications"][0]["id"], second.to_string());
+ assert_eq!(data["updateNotifications"][1]["id"], first.to_string());
+ assert_eq!(
+ service.calls.lock().unwrap().as_slice(),
+ [(
+ "macro|[email protected]".to_string(),
+ vec![second, first],
+ "seen",
+ ),]
+ );
+}
diff --git a/crates/graphql_notification/src/objects.rs b/crates/graphql_notification/src/objects.rs
index 24aa7d92c6..b3320e1d84 100644
--- a/crates/graphql_notification/src/objects.rs
+++ b/crates/graphql_notification/src/objects.rs
@@ -8,6 +8,12 @@ use crate::loaders::{EntityNotificationsLoader, SoupNotificationEdgeReader};
/// GraphQL notification attached to a Soup entity.
pub struct GraphqlSoupNotification(UserNotificationRow<serde_json::Value>);
+impl From<UserNotificationRow<serde_json::Value>> for GraphqlSoupNotification {
+ fn from(value: UserNotificationRow<serde_json::Value>) -> Self {
+ Self(value)
+ }
+}
+
/// A notification associated with a Soup entity.
#[Object]
impl GraphqlSoupNotification {
diff --git a/crates/notification/src/domain/ports.rs b/crates/notification/src/domain/ports.rs
index 6f6d014b89..57fc01f0c3 100644
--- a/crates/notification/src/domain/ports.rs
+++ b/crates/notification/src/domain/ports.rs
@@ -16,13 +16,13 @@ use uuid::Uuid;
use models_pagination::{CreatedAt, Query};
use crate::domain::models::device::DeviceType;
-use crate::domain::models::{PatchDelete, TaggedContent, UserNotificationStatusUpdate};
+use crate::domain::models::{TaggedContent, UserNotificationStatusUpdate};
use crate::domain::models::email_notification_digest::ports::{ClaimResult, DigestBatch};
use crate::domain::models::request::{NotificationEntityRef, NotificationListFilters};
use crate::domain::models::{
DeviceEndpoint, DisabledNotificationType, NotificationExtEmail, NotificationIdAndCollapseKey,
- NotificationStatusPatch, SendNotificationRequestBuilder, UserNotificationRow, VoipPushTarget,
+ SendNotificationRequestBuilder, UserNotificationRow, VoipPushTarget,
android::FCMMessage,
apple::{APNSPushNotification, VoipPushPayload},
mobile::MessageAttributes,
@@ -93,20 +93,20 @@ pub trait NotificationRepository: Send + Sync + 'static {
user_ids: &[MacroUserIdStr<'a>],
) -> impl Future<Output = Result<HashMap<MacroUserIdStr<'static>, Vec<DeviceEndpoint>>, Report>> + Send;
- /// Mark notifications as seen for a user.
+ /// Mark notifications as seen and return the updated user-owned rows.
fn mark_notifications_seen(
&self,
user_id: MacroUserIdStr<'_>,
notification_ids: &[Uuid],
- ) -> impl Future<Output = Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report>> + Send;
+ ) -> impl Future<Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>> + Send;
- /// Mark notifications as done or undone for a user.
+ /// Mark notifications as done or undone and return the updated user-owned rows.
fn mark_notifications_done(
&self,
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
done: bool,
- ) -> impl Future<Output = Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report>> + Send;
+ ) -> impl Future<Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>> + Send;
/// Get basic notification data (collapse keys) needed for push clearing.
fn get_basic_notifications(
diff --git a/crates/notification/src/domain/service/device/test.rs b/crates/notification/src/domain/service/device/test.rs
index cfc5ba2d97..762fd5812e 100644
--- a/crates/notification/src/domain/service/device/test.rs
+++ b/crates/notification/src/domain/service/device/test.rs
@@ -132,15 +132,7 @@ impl NotificationRepository for MockNotifRepo {
&self,
_: macro_user_id::user_id::MacroUserIdStr<'_>,
_: &[uuid::Uuid],
- ) -> Result<
- Vec<
- crate::domain::models::PatchDelete<
- uuid::Uuid,
- crate::domain::models::NotificationStatusPatch,
- >,
- >,
- Report,
- > {
+ ) -> Result<Vec<crate::domain::models::UserNotificationRow<serde_json::Value>>, Report> {
unimplemented!()
}
async fn mark_notifications_done(
@@ -148,15 +140,7 @@ impl NotificationRepository for MockNotifRepo {
_: &macro_user_id::user_id::MacroUserIdStr<'_>,
_: &[uuid::Uuid],
_: bool,
- ) -> Result<
- Vec<
- crate::domain::models::PatchDelete<
- uuid::Uuid,
- crate::domain::models::NotificationStatusPatch,
- >,
- >,
- Report,
- > {
+ ) -> Result<Vec<crate::domain::models::UserNotificationRow<serde_json::Value>>, Report> {
unimplemented!()
}
async fn get_basic_notifications(
diff --git a/crates/notification/src/domain/service/ingress.rs b/crates/notification/src/domain/service/ingress.rs
index bd52a2b7cc..8c5b45431f 100644
--- a/crates/notification/src/domain/service/ingress.rs
+++ b/crates/notification/src/domain/service/ingress.rs
@@ -19,8 +19,8 @@ use crate::domain::models::request::{
};
use crate::domain::models::{
DeviceEndpoint, DisabledNotificationType, Notification, NotificationResult,
- NotificationStatusUpdate, NotificationTypeName, UserNotificationRow,
- UserNotificationStatusUpdate,
+ NotificationStatusPatch, NotificationStatusUpdate, NotificationTypeName, PatchDelete,
+ UserNotificationRow, UserNotificationStatusUpdate,
};
use crate::domain::ports::{
NoopNotificationRealtimePublisher, NotificationIngressQueue, NotificationQueue,
@@ -56,12 +56,18 @@ pub trait NotificationIngress: Send + Sync + 'static {
/// This is separated from [`NotificationIngress`] because these operations
/// do not require the bulk-digest state machine.
pub trait NotificationReader: Send + Sync + 'static {
- /// Mark notifications as seen for a user and enqueue push notification clearing.
+ /// Update notifications for a user and enqueue any required push notification clearing.
fn update_notifications(
&self,
req: UpdateNotificationsRequest,
) -> impl Future<Output = Result<(), Report>> + Send;
+ /// Update notifications and return the authoritative active rows owned by the user.
+ fn update_notifications_and_return(
+ &self,
+ req: UpdateNotificationsRequest,
+ ) -> impl Future<Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>> + Send;
+
/// Get a user's non-deleted notifications, paginated.
///
/// Returns at most `limit` (default 20, max 500) notifications matching
@@ -489,7 +495,7 @@ where
async fn update_notifications_impl(
&self,
req: UpdateNotificationsRequest<'_>,
- ) -> Result<(), Report> {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
let changed = match &req.status {
NotificationStatus::Seen => {
self.repository
@@ -504,9 +510,20 @@ where
};
if !changed.is_empty() {
+ let updates = changed
+ .iter()
+ .map(|notification| PatchDelete::Patch {
+ id: notification.notification_id,
+ diff: NotificationStatusPatch {
+ done: notification.done,
+ viewed_at: notification.viewed_at,
+ updated_at: notification.updated_at,
+ },
+ })
+ .collect();
let update = UserNotificationStatusUpdate {
user: req.user_id.copied(),
- update: NotificationStatusUpdate::new(changed),
+ update: NotificationStatusUpdate::new(updates),
};
if let Err(err) = self.realtime.publish_updates(&[update]).await {
tracing::warn!(error = ?err, "failed to publish notification status realtime update");
@@ -514,7 +531,7 @@ where
}
if !req.status.should_clear_push_notifs() {
- return Ok(());
+ return Ok(changed);
}
let notifications_with_keys = self
@@ -523,7 +540,7 @@ where
.await?;
if notifications_with_keys.is_empty() {
- return Ok(());
+ return Ok(changed);
}
let device_endpoints = self
@@ -556,7 +573,7 @@ where
.collect();
if ios_endpoints.is_empty() {
- return Ok(());
+ return Ok(changed);
}
let messages: Vec<QueueMessage<'_, ClearPushIdentifier, ClearPushIdentifier>> =
@@ -594,7 +611,7 @@ where
self.queue.publish(messages).await?;
- Ok(())
+ Ok(changed)
}
}
@@ -605,11 +622,19 @@ where
S: SnsEndpointManager,
R: NotificationRealtimePublisher,
{
- fn update_notifications(
+ async fn update_notifications(
+ &self,
+ req: UpdateNotificationsRequest<'_>,
+ ) -> Result<(), Report> {
+ self.update_notifications_impl(req).await.map(|_| ())
+ }
+
+ #[tracing::instrument(err, skip(self))]
+ async fn update_notifications_and_return(
&self,
req: UpdateNotificationsRequest<'_>,
- ) -> impl Future<Output = Result<(), Report>> + Send {
- self.update_notifications_impl(req)
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
+ self.update_notifications_impl(req).await
}
#[tracing::instrument(err, skip(self))]
diff --git a/crates/notification/src/domain/service/push_notification_event/test.rs b/crates/notification/src/domain/service/push_notification_event/test.rs
index 2060e23490..1754805da6 100644
--- a/crates/notification/src/domain/service/push_notification_event/test.rs
+++ b/crates/notification/src/domain/service/push_notification_event/test.rs
@@ -99,15 +99,7 @@ impl NotificationRepository for MockNotifRepo {
&self,
_: macro_user_id::user_id::MacroUserIdStr<'_>,
_: &[uuid::Uuid],
- ) -> Result<
- Vec<
- crate::domain::models::PatchDelete<
- uuid::Uuid,
- crate::domain::models::NotificationStatusPatch,
- >,
- >,
- Report,
- > {
+ ) -> Result<Vec<crate::domain::models::UserNotificationRow<serde_json::Value>>, Report> {
unimplemented!()
}
async fn mark_notifications_done(
@@ -115,15 +107,7 @@ impl NotificationRepository for MockNotifRepo {
_: &macro_user_id::user_id::MacroUserIdStr<'_>,
_: &[uuid::Uuid],
_: bool,
- ) -> Result<
- Vec<
- crate::domain::models::PatchDelete<
- uuid::Uuid,
- crate::domain::models::NotificationStatusPatch,
- >,
- >,
- Report,
- > {
+ ) -> Result<Vec<crate::domain::models::UserNotificationRow<serde_json::Value>>, Report> {
unimplemented!()
}
async fn get_basic_notifications(
diff --git a/crates/notification/src/domain/service/test.rs b/crates/notification/src/domain/service/test.rs
index 2846a0790b..b4e8a9526b 100644
--- a/crates/notification/src/domain/service/test.rs
+++ b/crates/notification/src/domain/service/test.rs
@@ -13,9 +13,8 @@ use crate::domain::models::queue_message::{
use crate::domain::models::request::{NotificationStatus, UpdateNotificationsRequest};
use crate::domain::models::{
DeviceEndpoint, Notification, NotificationExtEmail, NotificationExtIos,
- NotificationIdAndCollapseKey, NotificationStatusPatch, PatchDelete, RateLimitConfig,
- RateLimitExceeded, RateLimitKey, RateLimitResult, SendNotificationRequestBuilder,
- TaggedContent, UserNotificationRow,
+ NotificationIdAndCollapseKey, RateLimitConfig, RateLimitExceeded, RateLimitKey,
+ RateLimitResult, SendNotificationRequestBuilder, TaggedContent, UserNotificationRow,
};
use crate::domain::ports::{
EmailSender, NotificationEgress, NotificationQueue, NotificationRepository, NotificationSender,
@@ -180,6 +179,29 @@ impl BulkDigestStateMachine for MockStateMachine {
}
}
+fn updated_notification(
+ user_id: MacroUserIdStr<'_>,
+ notification_id: Uuid,
+ done: bool,
+ viewed_at: Option<chrono::DateTime<Utc>>,
+ updated_at: chrono::DateTime<Utc>,
+) -> UserNotificationRow<serde_json::Value> {
+ UserNotificationRow {
+ owner_id: user_id.into_owned(),
+ notification_id,
+ notification_event_type: "test_notification".to_string(),
+ entity: EntityType::Document.with_entity_str("doc-1").into_owned(),
+ sent: true,
+ done,
+ created_at: updated_at,
+ viewed_at,
+ updated_at,
+ deleted_at: None,
+ notification_metadata: json!({}),
+ sender_id: None,
+ }
+}
+
impl NotificationRepository for MockRepository {
async fn get_muted_users<'a>(
&self,
@@ -254,12 +276,16 @@ impl NotificationRepository for MockRepository {
&self,
user_id: MacroUserIdStr<'_>,
notification_ids: &[Uuid],
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
self.mark_seen_calls
.lock()
.unwrap()
.push((user_id.to_string(), notification_ids.to_vec()));
- Ok(Vec::new())
+ let now = Utc::now();
+ Ok(notification_ids
+ .iter()
+ .map(|id| updated_notification(user_id.clone(), *id, false, Some(now), now))
+ .collect())
}
async fn mark_notifications_done(
@@ -267,13 +293,17 @@ impl NotificationRepository for MockRepository {
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
done: bool,
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
self.mark_done_calls.lock().unwrap().push((
user_id.to_string(),
notification_ids.to_vec(),
done,
));
- Ok(Vec::new())
+ let now = Utc::now();
+ Ok(notification_ids
+ .iter()
+ .map(|id| updated_notification(user_id.clone(), *id, done, None, now))
+ .collect())
}
async fn get_basic_notifications(
@@ -468,7 +498,7 @@ impl NotificationRepository for std::sync::Arc<MockRepository> {
&self,
user_id: MacroUserIdStr<'_>,
notification_ids: &[Uuid],
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
(**self)
.mark_notifications_seen(user_id, notification_ids)
.await
@@ -479,7 +509,7 @@ impl NotificationRepository for std::sync::Arc<MockRepository> {
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
done: bool,
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
(**self)
.mark_notifications_done(user_id, notification_ids, done)
.await
@@ -1574,6 +1604,44 @@ async fn test_mark_seen_skips_push_when_no_collapse_key() {
);
}
+#[tokio::test]
+async fn test_update_notifications_and_return_preserves_requested_order() {
+ let user = test_user_id("[email protected]");
+ let first = Uuid::now_v7();
+ let second = Uuid::now_v7();
+ let repo = Arc::new(MockRepository::new());
+ let service = NotificationReaderService {
+ repository: repo,
+ queue: Arc::new(MockQueue::new()),
+ sns_endpoint: MockSnsEndpoint,
+ platform_config: test_platform_config(),
+ realtime: crate::domain::ports::NoopNotificationRealtimePublisher,
+ };
+ let notification_ids = [second, first];
+
+ let updated = service
+ .update_notifications_and_return(UpdateNotificationsRequest {
+ user_id: user.clone(),
+ notification_ids: &notification_ids,
+ status: NotificationStatus::Done(false),
+ })
+ .await
+ .unwrap();
+
+ assert_eq!(
+ updated
+ .iter()
+ .map(|notification| notification.notification_id)
+ .collect::<Vec<_>>(),
+ notification_ids
+ );
+ assert!(
+ updated
+ .iter()
+ .all(|notification| notification.owner_id == user)
+ );
+}
+
#[tokio::test]
async fn test_mark_seen_skips_push_when_no_device_endpoints() {
use std::sync::Arc;
diff --git a/crates/notification/src/domain/service/voip/test.rs b/crates/notification/src/domain/service/voip/test.rs
index 0a03e47faa..4220f812fc 100644
--- a/crates/notification/src/domain/service/voip/test.rs
+++ b/crates/notification/src/domain/service/voip/test.rs
@@ -121,15 +121,7 @@ impl NotificationRepository for MockRepo {
&self,
_: MacroUserIdStr<'_>,
_: &[uuid::Uuid],
- ) -> Result<
- Vec<
- crate::domain::models::PatchDelete<
- uuid::Uuid,
- crate::domain::models::NotificationStatusPatch,
- >,
- >,
- Report,
- > {
+ ) -> Result<Vec<crate::domain::models::UserNotificationRow<serde_json::Value>>, Report> {
unimplemented!()
}
async fn mark_notifications_done(
@@ -137,15 +129,7 @@ impl NotificationRepository for MockRepo {
_: &MacroUserIdStr<'_>,
_: &[uuid::Uuid],
_: bool,
- ) -> Result<
- Vec<
- crate::domain::models::PatchDelete<
- uuid::Uuid,
- crate::domain::models::NotificationStatusPatch,
- >,
- >,
- Report,
- > {
+ ) -> Result<Vec<crate::domain::models::UserNotificationRow<serde_json::Value>>, Report> {
unimplemented!()
}
async fn get_basic_notifications(
diff --git a/crates/notification/src/inbound/http/test.rs b/crates/notification/src/inbound/http/test.rs
index 8a6483b130..6a1f576fc2 100644
--- a/crates/notification/src/inbound/http/test.rs
+++ b/crates/notification/src/inbound/http/test.rs
@@ -91,6 +91,14 @@ impl NotificationReader for AuthenticationTestService {
async { unreachable!("should not be called") }
}
+ fn update_notifications_and_return(
+ &self,
+ _req: UpdateNotificationsRequest,
+ ) -> impl Future<Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>> + Send
+ {
+ async { unreachable!("should not be called") }
+ }
+
fn get_user_notifications<T: DeserializeOwned + Send>(
&self,
_user_id: MacroUserIdStr<'_>,
@@ -564,6 +572,14 @@ impl NotificationReader for PresignedTestService {
async { unreachable!() }
}
+ fn update_notifications_and_return(
+ &self,
+ _req: UpdateNotificationsRequest,
+ ) -> impl Future<Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>> + Send
+ {
+ async { unreachable!() }
+ }
+
fn get_user_notifications<T: DeserializeOwned + Send>(
&self,
_user_id: MacroUserIdStr<'_>,
diff --git a/crates/notification/src/outbound/repository.rs b/crates/notification/src/outbound/repository.rs
index 2fc31319c8..c246421ade 100644
--- a/crates/notification/src/outbound/repository.rs
+++ b/crates/notification/src/outbound/repository.rs
@@ -9,8 +9,7 @@ use crate::domain::models::request::{
};
use crate::domain::models::{
DeviceEndpoint, DisabledNotificationType, NotificationIdAndCollapseKey,
- NotificationStatusPatch, PatchDelete, SendNotificationRequestBuilder, TaggedContent,
- UserNotificationRow,
+ SendNotificationRequestBuilder, TaggedContent, UserNotificationRow,
};
use crate::domain::ports::NotificationRepository;
use crate::outbound::device_registration::DeviceRegistrationDbOps;
@@ -63,6 +62,54 @@ struct EntityNotificationListRow {
sender_id: Option<String>,
}
+struct UpdatedUserNotificationRow {
+ owner_id: String,
+ notification_id: Uuid,
+ event_item_id: String,
+ event_item_type: String,
+ sent: bool,
+ done: bool,
+ created_at: DateTime<Utc>,
+ viewed_at: Option<DateTime<Utc>>,
+ updated_at: DateTime<Utc>,
+ deleted_at: Option<DateTime<Utc>>,
+ notification_metadata: serde_json::Value,
+ notification_event_type: String,
+ sender_id: Option<String>,
+}
+
+impl UpdatedUserNotificationRow {
+ fn into_domain(self) -> Result<UserNotificationRow<serde_json::Value>, Report> {
+ let entity = EntityType::from_str(&self.event_item_type)
+ .map_err(|error| rootcause::report!(error))?
+ .with_entity_string(self.event_item_id);
+ let sender_id = self
+ .sender_id
+ .as_deref()
+ .map(|sender| MacroUserIdStr::parse_from_str(sender).map(CowLike::into_owned))
+ .transpose()
+ .map_err(|error| rootcause::report!(error))?;
+ let owner_id = MacroUserIdStr::parse_from_str(&self.owner_id)
+ .map(CowLike::into_owned)
+ .map_err(|error| rootcause::report!(error))?;
+
+ Ok(UserNotificationRow {
+ owner_id,
+ notification_id: self.notification_id,
+ notification_event_type: self.notification_event_type,
+ entity,
+ sent: self.sent,
+ done: self.done,
+ created_at: self.created_at,
+ viewed_at: self.viewed_at,
+ updated_at: self.updated_at,
+ deleted_at: self.deleted_at,
+ notification_metadata: self.notification_metadata,
+ sender_id,
+ })
+ }
+}
+
struct UserNotificationsQueryArgs<'a> {
user_id: &'a str,
event_item_ids: Option<&'a [String]>,
@@ -423,23 +470,23 @@ pub trait NotificationDbOps: DeviceRegistrationDbOps + Send + Sync + 'static {
user_ids: &[MacroUserIdStr<'a>],
) -> impl std::future::Future<Output = Result<(), Report>> + Send;
- /// Mark notifications as seen for a user.
+ /// Mark notifications as seen and return the updated user-owned rows.
fn mark_notifications_seen(
&self,
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
) -> impl std::future::Future<
- Output = Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report>,
+ Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>,
> + Send;
- /// Mark notifications as done or undone for a user.
+ /// Mark notifications as done or undone and return the updated user-owned rows.
fn mark_notifications_done(
&self,
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
done: bool,
) -> impl std::future::Future<
- Output = Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report>,
+ Output = Result<Vec<UserNotificationRow<serde_json::Value>>, Report>,
> + Send;
/// Get basic notification data (collapse keys) for push clearing.
@@ -780,41 +827,50 @@ impl NotificationDbOps for PgPool {
&self,
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
- let user_id_str = user_id.to_string();
-
- let rows = sqlx::query!(
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
+ let rows = sqlx::query_as!(
+ UpdatedUserNotificationRow,
r#"
WITH updated AS (
UPDATE user_notification
SET seen_at = NOW()
WHERE user_id = $1 AND notification_id = ANY($2) AND deleted_at IS NULL
- RETURNING notification_id, done, seen_at::timestamptz as viewed_at
+ RETURNING
+ user_id,
+ notification_id,
+ sent,
+ done,
+ created_at,
+ seen_at,
+ deleted_at
)
SELECT
+ updated.user_id as owner_id,
updated.notification_id,
+ n.event_item_id,
+ n.event_item_type,
+ updated.sent,
updated.done,
- updated.viewed_at,
- NOW()::timestamptz as "updated_at!"
+ updated.created_at::timestamptz as "created_at!",
+ updated.seen_at::timestamptz as viewed_at,
+ NOW()::timestamptz as "updated_at!",
+ updated.deleted_at::timestamptz,
+ n.metadata as "notification_metadata: serde_json::Value",
+ n.notification_event_type,
+ n.sender_id
FROM updated
+ JOIN notification n ON n.id = updated.notification_id
+ ORDER BY array_position($2, updated.notification_id)
"#,
- user_id_str,
- notification_ids
+ user_id.as_ref(),
+ notification_ids,
)
.fetch_all(self)
.await?;
- Ok(rows
- .into_iter()
- .map(|row| PatchDelete::Patch {
- id: row.notification_id,
- diff: NotificationStatusPatch {
- done: row.done,
- viewed_at: row.viewed_at,
- updated_at: row.updated_at,
- },
- })
- .collect())
+ rows.into_iter()
+ .map(UpdatedUserNotificationRow::into_domain)
+ .collect()
}
async fn mark_notifications_done(
@@ -822,42 +878,51 @@ impl NotificationDbOps for PgPool {
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
done: bool,
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
- let user_id_str = user_id.to_string();
-
- let rows = sqlx::query!(
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
+ let rows = sqlx::query_as!(
+ UpdatedUserNotificationRow,
r#"
WITH updated AS (
UPDATE user_notification
SET done = $3
WHERE user_id = $1 AND notification_id = ANY($2) AND deleted_at IS NULL
- RETURNING notification_id, done, seen_at::timestamptz as viewed_at
+ RETURNING
+ user_id,
+ notification_id,
+ sent,
+ done,
+ created_at,
+ seen_at,
+ deleted_at
)
SELECT
+ updated.user_id as owner_id,
updated.notification_id,
+ n.event_item_id,
+ n.event_item_type,
+ updated.sent,
updated.done,
- updated.viewed_at,
- NOW()::timestamptz as "updated_at!"
+ updated.created_at::timestamptz as "created_at!",
+ updated.seen_at::timestamptz as viewed_at,
+ NOW()::timestamptz as "updated_at!",
+ updated.deleted_at::timestamptz,
+ n.metadata as "notification_metadata: serde_json::Value",
+ n.notification_event_type,
+ n.sender_id
FROM updated
+ JOIN notification n ON n.id = updated.notification_id
+ ORDER BY array_position($2, updated.notification_id)
"#,
- user_id_str,
+ user_id.as_ref(),
notification_ids,
- done
+ done,
)
.fetch_all(self)
.await?;
- Ok(rows
- .into_iter()
- .map(|row| PatchDelete::Patch {
- id: row.notification_id,
- diff: NotificationStatusPatch {
- done: row.done,
- viewed_at: row.viewed_at,
- updated_at: row.updated_at,
- },
- })
- .collect())
+ rows.into_iter()
+ .map(UpdatedUserNotificationRow::into_domain)
+ .collect()
}
async fn get_basic_notifications(
@@ -1524,7 +1589,7 @@ impl<D: NotificationDbOps + Send + Sync> NotificationRepository for DbNotificati
&self,
user_id: MacroUserIdStr<'_>,
notification_ids: &[Uuid],
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
self.db
.mark_notifications_seen(&user_id, notification_ids)
.await
@@ -1535,7 +1600,7 @@ impl<D: NotificationDbOps + Send + Sync> NotificationRepository for DbNotificati
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
done: bool,
- ) -> Result<Vec<PatchDelete<Uuid, NotificationStatusPatch>>, Report> {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
self.db
.mark_notifications_done(user_id, notification_ids, done)
.await
diff --git a/crates/notification/src/outbound/repository/test.rs b/crates/notification/src/outbound/repository/test.rs
index 893039f4d4..69f48ba48b 100644
--- a/crates/notification/src/outbound/repository/test.rs
+++ b/crates/notification/src/outbound/repository/test.rs
@@ -309,10 +309,17 @@ async fn test_mark_notifications_seen(pool: Pool<Postgres>) {
let user = test_user("[email protected]");
let notification_id = uuid::Uuid::parse_str("0193b1ea-a542-7589-893b-2b4a509c1e76").unwrap();
- pool.mark_notifications_seen(&user, &[notification_id])
+ let updated = pool
+ .mark_notifications_seen(&user, &[notification_id])
.await
.unwrap();
+ assert_eq!(updated.len(), 1);
+ assert_eq!(updated[0].owner_id, user);
+ assert_eq!(updated[0].notification_id, notification_id);
+ assert_eq!(updated[0].entity.entity_id, "item-1");
+ assert!(updated[0].viewed_at.is_some());
+
let row = sqlx::query!(
"SELECT seen_at FROM user_notification WHERE notification_id = $1 AND user_id = $2",
notification_id,
@@ -348,10 +355,14 @@ async fn test_mark_notifications_seen_does_not_affect_other_users(pool: Pool<Pos
.unwrap();
// Mark seen only for the first user
- pool.mark_notifications_seen(&user, &[notification_id])
+ let updated = pool
+ .mark_notifications_seen(&user, &[notification_id])
.await
.unwrap();
+ assert_eq!(updated.len(), 1);
+ assert_eq!(updated[0].owner_id, user);
+
// Other user's notification should still be unseen
let row = sqlx::query!(
"SELECT seen_at FROM user_notification WHERE notification_id = $1 AND user_id = $2",
@@ -365,6 +376,50 @@ async fn test_mark_notifications_seen_does_not_affect_other_users(pool: Pool<Pos
assert!(row.seen_at.is_none());
}
+#[sqlx::test(
+ migrator = "MACRO_DB_MIGRATIONS",
+ fixtures(
+ path = "../../../fixtures",
+ scripts("notifications_with_collapse_keys")
+ )
+)]
+async fn test_mark_notifications_done_returns_owned_rows_in_requested_order(pool: Pool<Postgres>) {
+ let user = test_user("[email protected]");
+ let other_user = test_user("[email protected]");
+ let first = uuid::Uuid::parse_str("0193b1ea-a542-7589-893b-2b4a509c1e76").unwrap();
+ let second = uuid::Uuid::parse_str("0193b1ea-b642-7589-893b-2b4a509c1e76").unwrap();
+ let other_only = uuid::Uuid::new_v4();
+ let request = SendNotificationRequestBuilder {
+ notification_entity: EntityType::Document.with_entity_str("doc-other"),
+ secondary_notification_entity: None,
+ notification: TaggedContent::new(TestNotification {
+ message: "other".to_string(),
+ }),
+ sender_id: None,
+ recipient_ids: std::collections::HashSet::from([other_user]),
+ };
+ pool.create_notification(request, other_only, "test_service", None)
+ .await
+ .unwrap();
+
+ let rows = pool
+ .mark_notifications_done(&user, &[second, other_only, first], true)
+ .await
+ .unwrap();
+
+ assert_eq!(
+ rows.iter()
+ .map(|notification| notification.notification_id)
+ .collect::<Vec<_>>(),
+ vec![second, first]
+ );
+ assert!(
+ rows.iter()
+ .all(|notification| notification.owner_id == user)
+ );
+ assert!(rows.iter().all(|notification| notification.done));
+}
+
#[sqlx::test(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(
diff --git a/services/document_storage_service/src/api/context.rs b/services/document_storage_service/src/api/context.rs
index 8c72c91d0c..7a94cdc840 100644
--- a/services/document_storage_service/src/api/context.rs
+++ b/services/document_storage_service/src/api/context.rs
@@ -166,6 +166,8 @@ pub(crate) type DssGraphqlSoupSchema = complete_graph::SharedSoupSchema<
ApiContext,
complete_graph::PropertiesEntityPropertyWriter<PropertiesService, EntityAccessService>,
DssEntityMutationService,
+ DssChannelService,
+ ai_tools::ToolNotificationService,
Arc<ai_tools::ToolNotificationService>,
complete_graph::PropertiesEntityPropertyReader<PropertiesService, EntityAccessService>,
complete_graph::EmailServiceEmailContentReader<DssEmailService, EntityAccessService>,
diff --git a/services/document_storage_service/src/api/graphql_soup.rs b/services/document_storage_service/src/api/graphql_soup.rs
index cf3a56d61e..95e3f6bd8f 100644
--- a/services/document_storage_service/src/api/graphql_soup.rs
+++ b/services/document_storage_service/src/api/graphql_soup.rs
@@ -143,11 +143,15 @@ fn graphql_query_context_data(
state.soup_router_state.email_service(),
);
let req = req
+ .data(macro_user_id.clone())
.data(entity_mutation::EntityMutationActor {
user_id: macro_user_id.clone(),
organization_id,
})
.data(state.graphql_entity_mutation_service.clone())
+ .data(state.channel_service.clone())
+ .data(state.graphql_notification_reader.clone())
+ .data(state.entity_access_service.clone())
.data(soup_item_loader);
req.data(complete_graph::entity_properties_loader(
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index 12d26c0f54..b7d11789af 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -1,3 +1,17 @@
+"""
+Channel activity operation exposed by GraphQL.
+"""
+enum ChannelActivityType {
+ """
+ Record that the user viewed the channel.
+ """
+ VIEW
+ """
+ Record that the user interacted with the channel.
+ """
+ INTERACT
+}
+
"""
Channel-specific entry inside the otherwise common share-policy model.
"""
@@ -17,8 +31,7 @@ input ChannelSharePolicyInput {
}
"""
-Mutation root combining property-specific and capability-oriented entity
-mutations without coupling either domain adapter to the other.
+Mutation root combining independent domain GraphQL adapters.
"""
type CompleteMutationRoot {
"""
@@ -57,6 +70,14 @@ type CompleteMutationRoot {
Add or remove an entity from the actor's favorites.
"""
setEntityFavorite(entity: EntityRefInput!, favorite: Boolean!): GraphqlEntityMutationResult!
+ """
+ Record a view or interaction in the authenticated user's channel activity.
+ """
+ recordChannelActivity(input: RecordChannelActivityInput!): GraphqlChannelActivity!
+ """
+ Update authenticated user-owned notifications and return authoritative rows.
+ """
+ updateNotifications(input: UpdateNotificationsInput!): [GraphqlSoupNotification!]!
}
"""
@@ -229,6 +250,40 @@ enum GraphqlCallStatus {
UNATTENDED
}
+"""
+GraphQL fields for authoritative channel activity.
+"""
+type GraphqlChannelActivity {
+ """
+ Stable activity row identifier.
+ """
+ id: ID!
+ """
+ User who owns this activity row.
+ """
+ userId: String!
+ """
+ Channel associated with the activity.
+ """
+ channelId: ID!
+ """
+ Activity row creation time in RFC 3339 format.
+ """
+ createdAt: String!
+ """
+ Activity row update time in RFC 3339 format.
+ """
+ updatedAt: String!
+ """
+ Most recent channel view time in RFC 3339 format.
+ """
+ viewedAt: String
+ """
+ Most recent channel interaction time in RFC 3339 format.
+ """
+ interactedAt: String
+}
+
"""
The two operands of a recursive `ChannelFilterExpr` binary expression.
"""
@@ -3161,6 +3216,38 @@ input MoveEntityInput {
projectId: ID
}
+"""
+Explicit notification status operation exposed by GraphQL.
+"""
+enum NotificationUpdateOperation {
+ """
+ Mark notifications as seen.
+ """
+ MARK_SEEN
+ """
+ Mark notifications as done.
+ """
+ MARK_DONE
+ """
+ Mark notifications as not done.
+ """
+ MARK_UNDONE
+}
+
+"""
+Input for recording authenticated channel activity.
+"""
+input RecordChannelActivityInput {
+ """
+ Channel receiving the activity update.
+ """
+ channelId: ID!
+ """
+ Kind of activity to record.
+ """
+ activityType: ChannelActivityType!
+}
+
"""
One entity rename in a batch.
"""
@@ -3319,6 +3406,20 @@ input UpdateEntitySharePolicyInput {
policy: EntitySharePolicyInput!
}
+"""
+Input for updating notification statuses.
+"""
+input UpdateNotificationsInput {
+ """
+ User notification identifiers to update.
+ """
+ notificationIds: [ID!]!
+ """
+ Status operation applied to every requested notification.
+ """
+ operation: NotificationUpdateOperation!
+}
+
"""
Directs the executor to include this field or fragment only when the `if` argument is true.
"""
diff --git a/tooling/notification_sandbox/src/adapters/sandbox_repository.rs b/tooling/notification_sandbox/src/adapters/sandbox_repository.rs
index ce9c55f6b3..41b29cf214 100644
--- a/tooling/notification_sandbox/src/adapters/sandbox_repository.rs
+++ b/tooling/notification_sandbox/src/adapters/sandbox_repository.rs
@@ -3,8 +3,8 @@ use models_pagination::{CreatedAt, Query};
use notification::domain::models::TaggedContent;
use notification::domain::models::request::{NotificationEntityRef, NotificationListFilters};
use notification::domain::models::{
- DeviceEndpoint, NotificationIdAndCollapseKey, NotificationStatusPatch,
- SendNotificationRequestBuilder, UserNotificationRow, device::DeviceType,
+ DeviceEndpoint, NotificationIdAndCollapseKey, SendNotificationRequestBuilder,
+ UserNotificationRow, device::DeviceType,
};
use notification::domain::ports::NotificationRepository;
use notification::outbound::repository::DbNotificationRepository;
@@ -89,8 +89,7 @@ impl NotificationRepository for SandboxNotificationRepository {
&self,
user_id: MacroUserIdStr<'_>,
notification_ids: &[Uuid],
- ) -> Result<Vec<notification::domain::models::PatchDelete<Uuid, NotificationStatusPatch>>, Report>
- {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
self.inner
.mark_notifications_seen(user_id, notification_ids)
.await
@@ -101,8 +100,7 @@ impl NotificationRepository for SandboxNotificationRepository {
user_id: &MacroUserIdStr<'_>,
notification_ids: &[Uuid],
done: bool,
- ) -> Result<Vec<notification::domain::models::PatchDelete<Uuid, NotificationStatusPatch>>, Report>
- {
+ ) -> Result<Vec<UserNotificationRow<serde_json::Value>>, Report> {
self.inner
.mark_notifications_done(user_id, notification_ids, done)
.await