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/graphql interface (#5162)

Sean Aye2ea825b31f2b
diff --git a/.github/workspace-dep-closures.json b/.github/workspace-dep-closures.json
index 2fc2a8a24a..87f70fd639 100644
--- a/.github/workspace-dep-closures.json
+++ b/.github/workspace-dep-closures.json
@@ -968,12 +968,16 @@
"crates/entity_access_db_utils",
"crates/entity_access_management",
"crates/entity_mutation",
+ "crates/favorites",
"crates/filter_ast",
"crates/foreign_entity",
"crates/frecency",
"crates/graphql_common",
"crates/graphql_email",
+ "crates/graphql_entity_mutation",
+ "crates/graphql_favorite",
"crates/graphql_notification",
+ "crates/graphql_permission",
"crates/graphql_properties",
"crates/graphql_soup",
"crates/invite_email",
@@ -1570,7 +1574,10 @@
"crates/github",
"crates/graphql_common",
"crates/graphql_email",
+ "crates/graphql_entity_mutation",
+ "crates/graphql_favorite",
"crates/graphql_notification",
+ "crates/graphql_permission",
"crates/graphql_properties",
"crates/graphql_soup",
"crates/import",
@@ -2783,6 +2790,71 @@
"crates/unfurl",
"crates/workspace-hack"
],
+ "graphql_entity_mutation": [
+ "crates/agent",
+ "crates/ai_toolset",
+ "crates/ai_usage",
+ "crates/attachment",
+ "crates/bot_id",
+ "crates/cowlike",
+ "crates/document_sub_type",
+ "crates/entity_access",
+ "crates/entity_mutation",
+ "crates/filter_ast",
+ "crates/graphql_common",
+ "crates/graphql_entity_mutation",
+ "crates/graphql_permission",
+ "crates/item_filters",
+ "crates/macro_auth",
+ "crates/macro_authorization",
+ "crates/macro_env",
+ "crates/macro_env_var",
+ "crates/macro_user_id",
+ "crates/macro_uuid",
+ "crates/model",
+ "crates/model-entity",
+ "crates/model-error-response",
+ "crates/model_file_type",
+ "crates/model_user",
+ "crates/models_bulk_upload",
+ "crates/models_pagination",
+ "crates/models_permissions",
+ "crates/models_properties",
+ "crates/non_empty",
+ "crates/prompt",
+ "crates/remote_env_var",
+ "crates/workspace-hack"
+ ],
+ "graphql_favorite": [
+ "crates/agent",
+ "crates/ai_toolset",
+ "crates/ai_usage",
+ "crates/attachment",
+ "crates/bot_id",
+ "crates/cowlike",
+ "crates/document_sub_type",
+ "crates/entity_access",
+ "crates/favorites",
+ "crates/graphql_favorite",
+ "crates/macro_auth",
+ "crates/macro_authorization",
+ "crates/macro_env",
+ "crates/macro_env_var",
+ "crates/macro_user_id",
+ "crates/macro_uuid",
+ "crates/model",
+ "crates/model-entity",
+ "crates/model-error-response",
+ "crates/model_file_type",
+ "crates/model_user",
+ "crates/models_bulk_upload",
+ "crates/models_pagination",
+ "crates/models_permissions",
+ "crates/non_empty",
+ "crates/prompt",
+ "crates/remote_env_var",
+ "crates/workspace-hack"
+ ],
"graphql_notification": [
"crates/ai_toolset",
"crates/bot_id",
@@ -2812,6 +2884,35 @@
"crates/remote_env_var",
"crates/workspace-hack"
],
+ "graphql_permission": [
+ "crates/agent",
+ "crates/ai_toolset",
+ "crates/ai_usage",
+ "crates/attachment",
+ "crates/bot_id",
+ "crates/cowlike",
+ "crates/document_sub_type",
+ "crates/entity_access",
+ "crates/graphql_permission",
+ "crates/macro_auth",
+ "crates/macro_authorization",
+ "crates/macro_env",
+ "crates/macro_env_var",
+ "crates/macro_user_id",
+ "crates/macro_uuid",
+ "crates/model",
+ "crates/model-entity",
+ "crates/model-error-response",
+ "crates/model_file_type",
+ "crates/model_user",
+ "crates/models_bulk_upload",
+ "crates/models_pagination",
+ "crates/models_permissions",
+ "crates/non_empty",
+ "crates/prompt",
+ "crates/remote_env_var",
+ "crates/workspace-hack"
+ ],
"graphql_properties": [
"crates/agent",
"crates/ai_toolset",
@@ -2888,6 +2989,7 @@
"crates/foreign_entity",
"crates/frecency",
"crates/graphql_common",
+ "crates/graphql_permission",
"crates/graphql_soup",
"crates/invite_email",
"crates/item_filters",
diff --git a/.helix/languages.toml b/.helix/languages.toml
new file mode 100644
index 0000000000..339192dbf5
--- /dev/null
+++ b/.helix/languages.toml
@@ -0,0 +1,8 @@
+# Keep rust-analyzer from loading or checking the Cloudflare Worker crate,
+# which must be compiled for WebAssembly rather than the host target.
+
+[language-server.rust-analyzer.config.files]
+exclude = ["services/sync-service"]
+
+[language-server.rust-analyzer.config.check]
+extraArgs = ["--exclude", "sync_service"]
diff --git a/Cargo.lock b/Cargo.lock
index 89a003cfae..9475a9652f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2892,9 +2892,13 @@ dependencies = [
"axum",
"email",
"entity_access",
+ "entity_mutation",
"graphql_common",
"graphql_email",
+ "graphql_entity_mutation",
+ "graphql_favorite",
"graphql_notification",
+ "graphql_permission",
"graphql_properties",
"graphql_soup",
"macro_authorization",
@@ -4246,6 +4250,7 @@ dependencies = [
"call",
"channel_bots",
"channels",
+ "chat",
"chrono",
"clap",
"cloudfront_sign",
@@ -4265,6 +4270,7 @@ dependencies = [
"embedding",
"entity_access",
"entity_access_management",
+ "entity_mutation",
"favorites",
"foreign_entity",
"frecency",
@@ -4320,6 +4326,7 @@ dependencies = [
"redis",
"regex",
"reqwest 0.13.4",
+ "rootcause",
"s3_key",
"saved_views",
"schemars 1.2.1",
@@ -6063,6 +6070,36 @@ dependencies = [
"workspace-hack",
]
+[[package]]
+name = "graphql_entity_mutation"
+version = "0.1.0"
+dependencies = [
+ "async-graphql",
+ "cowlike",
+ "entity_mutation",
+ "graphql_common",
+ "graphql_permission",
+ "macro_user_id",
+ "model-entity",
+ "models_permissions",
+ "tokio",
+ "workspace-hack",
+]
+
+[[package]]
+name = "graphql_favorite"
+version = "0.1.0"
+dependencies = [
+ "async-graphql",
+ "favorites",
+ "macro_user_id",
+ "model-entity",
+ "rootcause",
+ "tokio",
+ "tracing",
+ "workspace-hack",
+]
+
[[package]]
name = "graphql_notification"
version = "0.1.0"
@@ -6078,6 +6115,20 @@ dependencies = [
"workspace-hack",
]
+[[package]]
+name = "graphql_permission"
+version = "0.1.0"
+dependencies = [
+ "async-graphql",
+ "entity_access",
+ "futures",
+ "macro_user_id",
+ "model-entity",
+ "rootcause",
+ "tokio",
+ "workspace-hack",
+]
+
[[package]]
name = "graphql_properties"
version = "0.1.0"
@@ -6112,6 +6163,7 @@ dependencies = [
"filter_ast",
"futures",
"graphql_common",
+ "graphql_permission",
"item_filters",
"macro_authorization",
"macro_user_id",
@@ -16327,7 +16379,6 @@ version = "0.1.0"
dependencies = [
"ahash",
"aho-corasick",
- "async-graphql",
"aws-config",
"aws-credential-types",
"aws-runtime",
diff --git a/Cargo.toml b/Cargo.toml
index d7e29bf881..3eeab8867f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,10 @@ members = [
"crates/generic_email_domains",
"crates/graphql_common",
"crates/graphql_email",
+ "crates/graphql_entity_mutation",
+ "crates/graphql_favorite",
"crates/graphql_notification",
+ "crates/graphql_permission",
"crates/graphql_properties",
"crates/graphql_soup",
"crates/import",
diff --git a/apps/web/docs/graphql-normalized-cache-plan.md b/apps/web/docs/graphql-normalized-cache-plan.md
index 3a96588687..0ef072629c 100644
--- a/apps/web/docs/graphql-normalized-cache-plan.md
+++ b/apps/web/docs/graphql-normalized-cache-plan.md
@@ -40,12 +40,14 @@ entire cache in browser memory. With 10s of thousands of cached objects
7. **Async reads** — a disk-backed cache cannot offer graphcache's
synchronous `readQuery`. urql's exchange model (wonka streams) tolerates
async reads fine; imperative consumers get a Promise-based API.
-8. **Schema awareness** — `GraphqlSoupEntity` is a 9-variant union; the cache
- needs possible-types metadata and per-type key config (e.g.
- `GraphqlSoupChannelMessage.messageId`, embedded non-keyable types like the variants of
+8. **Schema awareness** — `GraphqlSoupEntity` is a 9-implementor interface;
+ the cache needs possible-types metadata and per-type key config (e.g.
+ `GraphqlSoupChannelMessage.id`, embedded non-keyable types like
`GraphqlPropertyValue`). Schema lives in-repo
(`static_assets/schema.graphql`) → embed metadata at build time, no
- runtime introspection.
+ runtime introspection. Lightweight channel-message previews are embedded
+ under `GraphqlSoupChannelMessagePreview` without an `id` field; only rich
+ thread rows use the normalized `GraphqlSoupChannelMessage` identity.
9. **External write API** — no GraphQL subscriptions exist; updates arrive
via websocket-service. Expose `writeFragment` / `invalidate(entityKey)` so
websocket handlers can patch records and trigger re-execution.
@@ -76,6 +78,18 @@ entire cache in browser memory. With 10s of thousands of cached objects
name a field `id` when it is a global identity — hence
`GraphqlProperty.propertyDefinitionId` and
`GraphqlSoupChannelMessage.id`); the build fails on malformed shapes.
+ Soup pages return entities directly: `frecencyScore` is a per-entity
+ fact shared by every view through the normalized record, and the only
+ per-view state is list membership and order, which live in each page's
+ own `items` list. Optimistic membership moves patch those reference
+ lists, while entity-field mutations update the shared records.
+
+ The normalized entity contract lives on `GraphqlSoupEntity`, not only on
+ its concrete implementations: `id`, `entityType`, `displayName`,
+ `metadata`, `properties`, `notifications`, `isFavorited`, and
+ `viewerPermission`. Queries can select shared relationships once at the
+ interface level. Content remains concrete/domain-specific because its
+ GraphQL shape and loading policy differ by entity type.
12. **Native-testable core** — the Rust engine is a pure crate (`cargo test`,
no wasm) with storage/clock behind traits.
13. **Durable optimistic mutations** — optimistic GraphQL mutations are
@@ -268,7 +282,7 @@ apps/web/src/lib/graphql-cache/ # JS glue
- Schema metadata codegen from `static_assets/schema.graphql`
(`build.rs`; key policy derived via the presence-of-id convention, build
fails on malformed shapes).
-- Normalize/denormalize for the real `Soup` query shape, union + fragment
+- Normalize/denormalize for the real `Soup` query shape, abstract types + fragment
handling, alias-aware storage, canonical-args field keys.
- Dependency index, LRU hot tier, in-memory Storage impl, engine with
batch-fetch read loop and changed-key/affected-ops write results.
diff --git a/apps/web/src/features/entity/queries/rename.ts b/apps/web/src/features/entity/queries/rename.ts
index 6345622663..49fd543592 100644
--- a/apps/web/src/features/entity/queries/rename.ts
+++ b/apps/web/src/features/entity/queries/rename.ts
@@ -1,6 +1,6 @@
-/** Rename mutations and their optimistic cache updates. */
import { renameItem } from '@core/component/FileList/itemOperations';
import { toast } from '@core/component/Toast/Toast';
+import { ENABLE_GRAPHQL_SOUP } from '@core/constant/featureFlags';
import { callKeys } from '@queries/call/keys';
import { channelKeys } from '@queries/channel/keys';
import { queryClient } from '@queries/client';
@@ -16,6 +16,13 @@ import type { CallRecord } from '@service-call/client';
import type { ApiChannelWithLatest } from '@service-storage/channel-list-types';
import type { ItemType } from '@service-storage/client';
import { ChannelTypeEnum } from '@service-storage/client';
+import {
+ type GraphqlEntityType,
+ RenameEntitiesDocument,
+ type RenameEntitiesMutation,
+ type RenameEntitiesMutationVariables,
+} from '@service-storage/graphql/generated/graphql';
+import { getEntityGraphqlClient } from '@service-storage/graphql-soup';
import { useMutation } from '@tanstack/solid-query';
import type { EntityData } from '../types/entity';
@@ -31,7 +38,8 @@ type EntityRenameOperationResult = {
success: boolean;
};
-// Keyed by entity ID so rollback indices stay aligned even when flatMap filters out types
+// Keyed by the full entity identity so heterogeneous or duplicate IDs cannot
+// overwrite another operation's rollback transaction.
type SoupTransactionMap = Map<string, SoupTransaction>;
type RenameRollbackContext = {
@@ -55,6 +63,25 @@ type RenameDssEntityMutationData = EntityRenameOperationResult;
type BulkRenameDssEntityMutationData = RenameDssEntityMutationData[];
+const MAX_ENTITY_MUTATION_BATCH = 100;
+
+const soupTransactionKey = (itemType: ItemType, id: string): string =>
+ `${itemType}:${id}`;
+
+const validateBulkRename = (
+ params: BulkRenameDssEntityMutationVariables
+): void => {
+ const seen = new Set<string>();
+ for (const { entity } of params) {
+ validateEntityRename(entity);
+ const key = `${entity.type}:${entity.id}`;
+ if (seen.has(key)) {
+ throw new Error(`Bulk rename contains duplicate entity ${key}`);
+ }
+ seen.add(key);
+ }
+};
+
type RenameOnMutateResult = {
contexts: RenameRollbackContext;
updates: EntityRenameData[];
@@ -83,7 +110,50 @@ const performEntityRename = async (operation: EntityRenameOperation) => {
return { success };
};
-const validateEntityRename = (entity: EntityData): void => {
+function graphqlRenameType(
+ entity: RenamableEntity
+): GraphqlEntityType | undefined {
+ switch (entity.type) {
+ case 'document':
+ return 'DOCUMENT';
+ case 'chat':
+ return 'CHAT';
+ case 'project':
+ return 'PROJECT';
+ case 'channel':
+ return 'CHANNEL';
+ case 'call':
+ return 'CALL';
+ default:
+ return undefined;
+ }
+}
+
+async function performGraphqlRenames(
+ operations: EntityRenameOperation[]
+): Promise<RenameDssEntityMutationData[]> {
+ const inputs = operations.map(({ entity, newName }) => {
+ const type = graphqlRenameType(entity);
+ if (!type) throw new Error(`Unsupported GraphQL rename: ${entity.type}`);
+ return {
+ entity: { type, id: entity.id },
+ displayName: newName,
+ };
+ });
+ const result = await getEntityGraphqlClient()
+ .mutation<RenameEntitiesMutation, RenameEntitiesMutationVariables>(
+ RenameEntitiesDocument,
+ { inputs }
+ )
+ .toPromise();
+ if (result.error) throw result.error;
+ if (!result.data) throw new Error('GraphQL rename returned no data');
+ return result.data.renameEntities.results.map((result) => ({
+ success: result.__typename === 'GraphqlMutationSuccess',
+ }));
+}
+
+const validateEntityRename = (entity: RenamableEntity): void => {
switch (entity.type) {
case 'channel':
// NOTE: channel type is undefined if provided from the split modal due to casting in createEntityData
@@ -112,7 +182,7 @@ const renameDssSetData = (
const score = current?.frecency_score ?? 0;
if (itemType === 'channel') {
txns.set(
- id,
+ soupTransactionKey(itemType, id),
optimisticUpdateSoupEntity({
tag: 'channel',
data: { channel: { id, name: newName } },
@@ -121,7 +191,7 @@ const renameDssSetData = (
);
} else if (itemType === 'call') {
txns.set(
- id,
+ soupTransactionKey(itemType, id),
optimisticUpdateSoupEntity({
tag: 'call',
data: { callId: id, customName: newName },
@@ -141,7 +211,7 @@ const renameDssSetData = (
itemType !== 'crm_contact'
) {
txns.set(
- id,
+ soupTransactionKey(itemType, id),
optimisticUpdateSoupEntity({
tag: itemType,
data: { id, name: newName },
@@ -238,17 +308,63 @@ function rollbackOptimisticRenameUpdates({
const bulkRenameMutationFn = async (
params: BulkRenameDssEntityMutationVariables
): Promise<BulkRenameDssEntityMutationData> => {
- const entities = params.map((p) => p.entity);
- entities.forEach(validateEntityRename);
+ validateBulkRename(params);
+
+ if (!ENABLE_GRAPHQL_SOUP()) {
+ return await Promise.all(params.map(performEntityRename));
+ }
+
+ const results: Array<RenameDssEntityMutationData | undefined> = new Array(
+ params.length
+ );
+ const graphqlOperations = params
+ .map((operation, index) => ({ operation, index }))
+ .filter(({ operation }) => graphqlRenameType(operation.entity));
+ const legacyOperations = params
+ .map((operation, index) => ({ operation, index }))
+ .filter(({ operation }) => !graphqlRenameType(operation.entity));
+ if (graphqlOperations.length > MAX_ENTITY_MUTATION_BATCH) {
+ throw new Error(
+ `Bulk rename accepts at most ${MAX_ENTITY_MUTATION_BATCH} GraphQL entities`
+ );
+ }
+
+ const [graphqlResults, legacyResults] = await Promise.all([
+ graphqlOperations.length > 0
+ ? performGraphqlRenames(
+ graphqlOperations.map(({ operation }) => operation)
+ ).catch((error) => {
+ console.error('GraphQL rename batch failed', error);
+ return graphqlOperations.map(() => ({ success: false }));
+ })
+ : Promise.resolve([]),
+ Promise.all(
+ legacyOperations.map(async ({ operation }) => {
+ try {
+ return await performEntityRename(operation);
+ } catch (error) {
+ console.error('Legacy rename failed', operation, error);
+ return { success: false };
+ }
+ })
+ ),
+ ]);
+ graphqlOperations.forEach(({ index }, resultIndex) => {
+ results[index] = graphqlResults[resultIndex];
+ });
+ legacyOperations.forEach(({ index }, resultIndex) => {
+ results[index] = legacyResults[resultIndex];
+ });
- // TODO: add bulk rename on backend or consider batching in chunks
- // with timeouts to avoid too many requests
- return await Promise.all(params.map(performEntityRename));
+ return results.map((result) => result ?? { success: false });
};
const bulkRenameOnMutate = (
params: BulkRenameDssEntityMutationVariables
): RenameOnMutateResult => {
+ // TanStack runs onMutate before mutationFn. Validate before the first cache
+ // write so an invalid batch cannot require a best-effort rollback.
+ validateBulkRename(params);
const updates = params
.map(getEntityRenameData)
.filter((d): d is EntityRenameData => d !== null);
@@ -289,8 +405,9 @@ const bulkRenameOnSettled = (
const update = onMutateResult.updates[index];
if (update) {
failedUpdates.push(update);
- const txn = onMutateResult.contexts.soupTransactions.get(update.id);
- if (txn) failedSoupTransactions.set(update.id, txn);
+ const key = soupTransactionKey(update.itemType, update.id);
+ const txn = onMutateResult.contexts.soupTransactions.get(key);
+ if (txn) failedSoupTransactions.set(key, txn);
}
}
});
diff --git a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts
index 5e1fbb69e2..a26e0a6855 100644
--- a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts
+++ b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts
@@ -41,6 +41,42 @@ const MUTATION = gql`
}
`;
+const RENAME_MUTATION = gql`
+ mutation RenameEntities($inputs: [RenameEntityInput!]!) {
+ renameEntities(inputs: $inputs) {
+ results {
+ __typename
+ ... on GraphqlMutationSuccess {
+ affectedEntities {
+ entityType
+ id
+ }
+ }
+ ... on GraphqlMutationError {
+ errorCode
+ message
+ }
+ }
+ }
+ }
+`;
+
+const ALIASED_RENAME_MUTATION = gql`
+ mutation RenameEntities($inputs: [RenameEntityInput!]!) {
+ renamed: renameEntities(inputs: $inputs) {
+ results {
+ __typename
+ ... on GraphqlMutationSuccess {
+ touched: affectedEntities {
+ kind: entityType
+ key: id
+ }
+ }
+ }
+ }
+ }
+`;
+
type FakeHost = CacheHost & {
reads: Array<{ opKey?: number; query: string; variables?: object }>;
writes: Array<{ opKey?: number; data: unknown; identity?: string }>;
@@ -53,6 +89,7 @@ type FakeHost = CacheHost & {
rollbacks: string[];
defers: Array<{ transactionId: string; error: string }>;
claims: string[];
+ invalidations: string[][];
teardowns: number[];
scriptRead: (result: ReadResult) => void;
seedQueued: (args: Parameters<CacheHost['beginOptimisticWrite']>[0]) => void;
@@ -78,6 +115,7 @@ function makeFakeHost(): FakeHost {
rollbacks: [],
defers: [],
claims: [],
+ invalidations: [],
teardowns: [],
scriptRead: (r) => {
readResult = r;
@@ -185,6 +223,10 @@ function makeFakeHost(): FakeHost {
async invalidate() {
return [];
},
+ async deleteRecords(keys) {
+ host.invalidations.push(keys);
+ return [];
+ },
async teardown(opKey) {
host.teardowns.push(opKey);
},
@@ -242,6 +284,29 @@ function makeMutationOp(key: number, optimisticResponse?: unknown): Operation {
);
}
+function makeRenameMutationOp(key: number, aliased = false): Operation {
+ return makeOperation(
+ 'mutation',
+ {
+ key,
+ query: aliased ? ALIASED_RENAME_MUTATION : RENAME_MUTATION,
+ variables: {
+ inputs: [
+ {
+ entity: { type: 'DOCUMENT', id: 'document-1' },
+ displayName: 'Renamed',
+ },
+ ],
+ },
+ },
+ {
+ requestPolicy: 'cache-first',
+ url: 'http://test',
+ suspense: false,
+ } as never
+ );
+}
+
/** Runs the exchange over a manual operation stream. */
function harness(
host: CacheHost,
@@ -838,6 +903,110 @@ describe('normalizedCacheExchange', () => {
expect(results).toHaveLength(1);
});
+ it('deletes deduplicated entity records identified by mutation refs', async () => {
+ const data = {
+ renameEntities: {
+ results: [
+ {
+ __typename: 'GraphqlMutationSuccess',
+ affectedEntities: [
+ { entityType: 'PROJECT', id: 'project-1' },
+ { entityType: 'DOCUMENT', id: 'document-1' },
+ { entityType: 'DOCUMENT', id: 'document-1' },
+ ],
+ },
+ ],
+ },
+ };
+ const { ops } = harness(host, () => ({ data }));
+
+ ops.next(makeRenameMutationOp(9));
+ await tick();
+
+ expect(host.invalidations).toHaveLength(1);
+ expect(new Set(host.invalidations[0])).toEqual(
+ new Set([
+ 'GraphqlSoupDocument:document-1',
+ 'GraphqlSoupProject:project-1',
+ ])
+ );
+ });
+
+ it('deletes requested records even when the response omits entity refs', async () => {
+ const { ops } = harness(host, () => ({
+ data: {
+ renameEntities: {
+ results: [
+ {
+ __typename: 'GraphqlMutationSuccess',
+ affectedEntities: [],
+ },
+ ],
+ },
+ },
+ }));
+
+ ops.next(makeRenameMutationOp(9));
+ await tick();
+
+ expect(host.invalidations).toEqual([['GraphqlSoupDocument:document-1']]);
+ });
+
+ it('reads affected entity refs through GraphQL aliases', async () => {
+ const data = {
+ renamed: {
+ results: [
+ {
+ __typename: 'GraphqlMutationSuccess',
+ touched: [
+ { kind: 'DOCUMENT', key: 'document-1' },
+ { kind: 'PROJECT', key: 'project-1' },
+ ],
+ },
+ ],
+ },
+ };
+ const { ops } = harness(host, () => ({ data }));
+
+ ops.next(makeRenameMutationOp(9, true));
+ await tick();
+
+ expect(new Set(host.invalidations[0])).toEqual(
+ new Set([
+ 'GraphqlSoupDocument:document-1',
+ 'GraphqlSoupProject:project-1',
+ ])
+ );
+ });
+
+ it('reports record deletion errors without dropping the mutation result', async () => {
+ const failure = new Error('cache deletion failed');
+ host.deleteRecords = async () => {
+ throw failure;
+ };
+ const onCacheError = vi.fn();
+ const data = {
+ renameEntities: {
+ results: [
+ {
+ __typename: 'GraphqlMutationSuccess',
+ affectedEntities: [],
+ },
+ ],
+ },
+ };
+ const { ops, results } = harness(host, () => ({ data }), {
+ onCacheError,
+ });
+ const op = makeRenameMutationOp(9);
+
+ ops.next(op);
+ await tick();
+
+ expect(onCacheError).toHaveBeenCalledWith(failure, op);
+ expect(results[0]?.data).toBe(data);
+ });
+
it('degrades to a plain network mutation when the optimistic setup fails', async () => {
host.beginOptimisticWrite = async () => {
throw new Error('idb exploded');
diff --git a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts
index c01fbd52c4..dcd4eac88d 100644
--- a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts
+++ b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts
@@ -42,6 +42,7 @@ import {
Kind,
type OperationDefinitionNode,
parse,
+ visit,
} from 'graphql';
import {
empty,
@@ -170,6 +171,115 @@ function cacheResult(
};
}
+const entityCacheTypeByApiType: Readonly<Record<string, string>> = {
+ DOCUMENT: 'GraphqlSoupDocument',
+ CHAT: 'GraphqlSoupChat',
+ PROJECT: 'GraphqlSoupProject',
+ EMAIL_THREAD: 'GraphqlSoupEmailThread',
+ CHANNEL: 'GraphqlSoupChannel',
+ CHANNEL_MESSAGE: 'GraphqlSoupChannelMessage',
+ CALL: 'GraphqlSoupCall',
+ CRM_COMPANY: 'GraphqlSoupCrmCompany',
+ FOREIGN_ENTITY: 'GraphqlSoupForeignEntity',
+};
+
+type MutationResponseKeys = {
+ affectedEntities: Set<string>;
+ entityType: Set<string>;
+ id: Set<string>;
+};
+
+function mutationResponseKeys(op: Operation): MutationResponseKeys {
+ const keys: MutationResponseKeys = {
+ affectedEntities: new Set(),
+ entityType: new Set(),
+ id: new Set(),
+ };
+ visit(op.query, {
+ Field(node) {
+ const name = node.name.value as keyof MutationResponseKeys;
+ if (name in keys) keys[name].add(node.alias?.value ?? node.name.value);
+ },
+ });
+ return keys;
+}
+
+function cacheKey(apiType: unknown, entityId: unknown): string | undefined {
+ if (typeof entityId !== 'string' || typeof apiType !== 'string') return;
+ const cacheType = entityCacheTypeByApiType[apiType];
+ return cacheType ? `${cacheType}:${entityId}` : undefined;
+}
+
+/** Collect requested refs from mutation variables, independent of selections. */
+function mutationInputCacheKeys(variables: unknown): Set<string> {
+ const keys = new Set<string>();
+ const seen = new Set<object>();
+ const pending: unknown[] = [variables];
+ while (pending.length > 0) {
+ const value = pending.pop();
+ if (value === null || typeof value !== 'object' || seen.has(value))
+ continue;
+ seen.add(value);
+ if (Array.isArray(value)) {
+ pending.push(...value);
+ continue;
+ }
+ const record = value as Record<string, unknown>;
+ const key = cacheKey(record.type, record.id);
+ if (key) keys.add(key);
+ if (typeof record.projectId === 'string') {
+ keys.add(`GraphqlSoupProject:${record.projectId}`);
+ }
+ pending.push(...Object.values(record));
+ }
+ return keys;
+}
+
+/** Collect normalized keys from mutation inputs and selected affected refs. */
+function mutationCacheKeys(data: unknown, op: Operation): string[] {
+ const responseKeys = mutationResponseKeys(op);
+ const keys = mutationInputCacheKeys(op.variables);
+ const seen = new Set<object>();
+ const pending: unknown[] = [data];
+
+ const addRefs = (value: unknown): void => {
+ if (Array.isArray(value)) {
+ for (const item of value) addRefs(item);
+ return;
+ }
+ if (value === null || typeof value !== 'object') return;
+ const ref = value as Record<string, unknown>;
+ const entityId = [...responseKeys.id]
+ .map((key) => ref[key])
+ .find((candidate) => typeof candidate === 'string');
+ const apiType = [...responseKeys.entityType]
+ .map((key) => ref[key])
+ .find((candidate) => typeof candidate === 'string');
+ const key = cacheKey(apiType, entityId);
+ if (key) keys.add(key);
+ };
+
+ while (pending.length > 0) {
+ const value = pending.pop();
+ if (value === null || typeof value !== 'object' || seen.has(value))
+ continue;
+ seen.add(value);
+ if (Array.isArray(value)) {
+ pending.push(...value);
+ continue;
+ }
+ for (const [field, child] of Object.entries(value)) {
+ if (responseKeys.affectedEntities.has(field)) {
+ addRefs(child);
+ } else {
+ pending.push(child);
+ }
+ }
+ }
+
+ return [...keys];
+}
+
function queuedMutationResult(
op: Operation,
transactionId: string
@@ -545,6 +655,8 @@ export function normalizedCacheExchange(
data: result.data,
}
);
+ const keys = mutationCacheKeys(result.data, op);
+ if (keys.length > 0) await host.deleteRecords(keys);
revalidateAfterCommit(committed.revalidations ?? [], op);
disposition = 'committed';
}
@@ -580,6 +692,8 @@ export function normalizedCacheExchange(
variables: op.variables as Record<string, unknown> | undefined,
data: result.data,
});
+ const keys = mutationCacheKeys(result.data, op);
+ if (keys.length > 0) await host.deleteRecords(keys);
} catch (error) {
options.onCacheError?.(error, op);
}
diff --git a/apps/web/src/lib/graphql-cache/exchange/optimistic.ts b/apps/web/src/lib/graphql-cache/exchange/optimistic.ts
index ecd578894d..288c325e43 100644
--- a/apps/web/src/lib/graphql-cache/exchange/optimistic.ts
+++ b/apps/web/src/lib/graphql-cache/exchange/optimistic.ts
@@ -210,10 +210,9 @@ export function prependUnique(entityKey: string): LinkDiff {
return { kind: 'prependUnique', entityKey };
}
-/** Compiles a generated graph selection and list diff into a durable update. */
-export function update<TItem extends object>(
+function compileUpdate<TItem extends object>(
selection: ListSelection<TItem>,
- operation: LinkDiff
+ operation: OptimisticLinkPatchWire['operation']
): OptimisticUpdate {
return {
query: stringifyDocument(selection.document),
@@ -224,6 +223,14 @@ export function update<TItem extends object>(
} as OptimisticUpdate;
}
+/** Compiles a generated graph selection and list diff into a durable update. */
+export function update<TItem extends object>(
+ selection: ListSelection<TItem>,
+ operation: LinkDiff
+): OptimisticUpdate {
+ return compileUpdate(selection, operation);
+}
+
/**
* Executes `document` with one durable optimistic entity/link transaction.
* The source resolves with the head's network result or a synthetic queued
diff --git a/apps/web/src/lib/graphql-cache/host/noop-host.ts b/apps/web/src/lib/graphql-cache/host/noop-host.ts
index 9c985ae06b..4e61c4d8a5 100644
--- a/apps/web/src/lib/graphql-cache/host/noop-host.ts
+++ b/apps/web/src/lib/graphql-cache/host/noop-host.ts
@@ -53,6 +53,9 @@ export function createNoopCacheHost(reason: string): CacheHost {
async invalidate(): Promise<string[]> {
return [];
},
+ async deleteRecords(): Promise<string[]> {
+ return [];
+ },
async teardown(): Promise<void> {},
async clear(): Promise<void> {},
onOpsAffected() {
diff --git a/apps/web/src/lib/graphql-cache/host/tauri-host.ts b/apps/web/src/lib/graphql-cache/host/tauri-host.ts
index 935ecbf684..3e8b2e7162 100644
--- a/apps/web/src/lib/graphql-cache/host/tauri-host.ts
+++ b/apps/web/src/lib/graphql-cache/host/tauri-host.ts
@@ -281,6 +281,11 @@ export function createTauriCacheHost(options: TauriHostOptions): CacheHost {
return await request<string[]>('graphql_cache_invalidate', { keys });
},
+ async deleteRecords(keys: string[]): Promise<string[]> {
+ await ready;
+ return await request<string[]>('graphql_cache_delete_records', { keys });
+ },
+
async teardown(opKey: number): Promise<void> {
await ready;
await request('graphql_cache_teardown', { opId: opId(opKey) });
diff --git a/apps/web/src/lib/graphql-cache/host/types.ts b/apps/web/src/lib/graphql-cache/host/types.ts
index 7bf3fd3207..b4f87d2608 100644
--- a/apps/web/src/lib/graphql-cache/host/types.ts
+++ b/apps/web/src/lib/graphql-cache/host/types.ts
@@ -89,6 +89,8 @@ export interface CacheHost {
): Promise<WriteResult>;
/** Evict records by entity key (external/push updates); returns affected local op ids. */
invalidate(keys: string[]): Promise<string[]>;
+ /** Delete stale durable records after a server mutation returns only refs. */
+ deleteRecords(keys: string[]): Promise<string[]>;
/** urql teardown for an operation key. */
teardown(opKey: number): Promise<void>;
/** Wipe all cached state (logout). */
diff --git a/apps/web/src/lib/graphql-cache/host/worker-host.ts b/apps/web/src/lib/graphql-cache/host/worker-host.ts
index b5c7ee86de..17b1889136 100644
--- a/apps/web/src/lib/graphql-cache/host/worker-host.ts
+++ b/apps/web/src/lib/graphql-cache/host/worker-host.ts
@@ -307,6 +307,11 @@ export function createWorkerCacheHost(options: WorkerHostOptions): CacheHost {
return (await request({ kind: 'invalidate', keys })) as string[];
},
+ async deleteRecords(keys: string[]): Promise<string[]> {
+ await ready;
+ return (await request({ kind: 'delete-records', keys })) as string[];
+ },
+
async teardown(opKey: number): Promise<void> {
await ready;
await request({ kind: 'teardown', opId: opId(opKey) });
diff --git a/apps/web/src/lib/graphql-cache/protocol.ts b/apps/web/src/lib/graphql-cache/protocol.ts
index 80a1e446b2..c1e35401a2 100644
--- a/apps/web/src/lib/graphql-cache/protocol.ts
+++ b/apps/web/src/lib/graphql-cache/protocol.ts
@@ -217,6 +217,8 @@ export type CacheRequest = { id: number } & (
| { kind: 'teardown'; opId: string }
/** External invalidation (e.g. websocket push): evict + report ops. */
| { kind: 'invalidate'; keys: string[] }
+ /** Delete stale durable records after a server mutation returns only refs. */
+ | { kind: 'delete-records'; keys: string[] }
| { kind: 'clear' }
);
diff --git a/apps/web/src/lib/graphql-cache/worker/wasm-module.ts b/apps/web/src/lib/graphql-cache/worker/wasm-module.ts
index 07d9c1d9c4..1ef8ed2d3c 100644
--- a/apps/web/src/lib/graphql-cache/worker/wasm-module.ts
+++ b/apps/web/src/lib/graphql-cache/worker/wasm-module.ts
@@ -21,6 +21,7 @@ import type {
} from '../protocol';
export interface CacheEngine {
+ boundIdentity(): Promise<string | null>;
readQuery(
opId: string | undefined,
query: string,
@@ -83,6 +84,7 @@ export interface CacheEngine {
leaseGeneration: string
): Promise<WriteResult>;
invalidateKeys(keys: string[]): Promise<string[]>;
+ deleteKeys(keys: string[]): Promise<string[]>;
teardownOperation(opId: string): Promise<void>;
clear(): Promise<void>;
/** Close the IndexedDB connection; call before destroyCache. */
diff --git a/apps/web/src/lib/graphql-cache/worker/worker-core.ts b/apps/web/src/lib/graphql-cache/worker/worker-core.ts
index cdc7a1d196..515c8b3b14 100644
--- a/apps/web/src/lib/graphql-cache/worker/worker-core.ts
+++ b/apps/web/src/lib/graphql-cache/worker/worker-core.ts
@@ -189,6 +189,20 @@ export class CacheWorkerCore {
);
return affectedOps;
})
+ .with({ kind: 'delete-records' }, async (request) => {
+ const engine = this.requireEngine();
+ const affectedOps = await engine.deleteKeys(request.keys);
+ this.fanOut(
+ {
+ changed: request.keys,
+ affectedOps,
+ reset: false,
+ revalidations: [],
+ },
+ true
+ );
+ return affectedOps;
+ })
.with({ kind: 'teardown' }, async (request) => {
await this.requireEngine().teardownOperation(request.opId);
return null;
diff --git a/apps/web/src/lib/queries/history/graphql.ts b/apps/web/src/lib/queries/history/graphql.ts
index 02e8bc664d..3195a9fb84 100644
--- a/apps/web/src/lib/queries/history/graphql.ts
+++ b/apps/web/src/lib/queries/history/graphql.ts
@@ -17,7 +17,7 @@ const graphqlHistorySelection = selectRecords(
);
type GraphqlHistoryRecord = GraphqlHistoryItemFieldsFragment;
-type GraphqlHistoryEntity = GraphqlHistoryRecord['entity'];
+type GraphqlHistoryEntity = GraphqlHistoryRecord;
type GraphqlDocumentHistoryEntity = Extract<
GraphqlHistoryEntity,
{ __typename: 'GraphqlSoupDocument' }
@@ -28,16 +28,14 @@ function transformDocumentSubType(
): DocumentHistoryItem['subType'] {
if (!subType) return subType;
- switch (subType.kind.toLowerCase()) {
- case 'task':
+ switch (subType.__typename) {
+ case 'GraphqlTaskSubType':
return {
type: 'task',
- is_completed: subType.isCompleted ?? false,
+ is_completed: subType.isCompleted,
};
- case 'snippet':
+ case 'GraphqlSnippetSubType':
return { type: 'snippet' };
- default:
- return undefined;
}
}
@@ -45,7 +43,7 @@ function transformDocumentSubType(
export function transformGraphqlHistoryItem(
record: GraphqlHistoryRecord
): HistoryItem | undefined {
- const entity = record.entity;
+ const entity = record;
switch (entity.__typename) {
case 'GraphqlSoupDocument': {
const subType = transformDocumentSubType(entity.subType);
@@ -99,7 +97,7 @@ export function transformGraphqlHistoryItem(
}
function getSortTimestamp(record: GraphqlHistoryRecord): number {
- const entity = record.entity;
+ const entity = record;
switch (entity.__typename) {
case 'GraphqlSoupDocument':
case 'GraphqlSoupChat':
diff --git a/apps/web/src/lib/queries/properties/entity.ts b/apps/web/src/lib/queries/properties/entity.ts
index 13257c3eea..ff6de062f5 100644
--- a/apps/web/src/lib/queries/properties/entity.ts
+++ b/apps/web/src/lib/queries/properties/entity.ts
@@ -846,6 +846,7 @@ export function useBulkSaveEntityPropertiesMutation(
optimisticCache = await buildOptimisticGroupedPropertyUpdates({
host,
entityId: item.entityId,
+ entityType: item.entityType,
propertyDefinitionId: item.property.propertyDefinitionId,
oldGroupKeys: oldGroupKeys ?? [],
newGroupKeys: newGroupKeys ?? [],
diff --git a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.ts b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.ts
index 9b0f00f12a..320e1d9260 100644
--- a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.ts
+++ b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.test.ts
@@ -101,6 +101,7 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host({ includeUnrelated: true }),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: ['in-progress'],
newGroupKeys: ['completed'],
@@ -108,8 +109,8 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
expect(result.updates).toHaveLength(2);
expect(result.updates.map((patch) => patch.operation)).toEqual([
- { kind: 'remove', entityKey: 'GraphqlSoupItem:task-1' },
- { kind: 'prependUnique', entityKey: 'GraphqlSoupItem:task-1' },
+ { kind: 'remove', entityKey: 'GraphqlSoupDocument:task-1' },
+ { kind: 'prependUnique', entityKey: 'GraphqlSoupDocument:task-1' },
]);
expect(result.updates.map((update) => update.path)).toEqual([
[
@@ -134,6 +135,7 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host({ destination: false }),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: ['in-progress'],
newGroupKeys: ['completed'],
@@ -148,6 +150,7 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host({ continuation: true, initialContainsItem: false }),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: ['in-progress'],
newGroupKeys: ['completed'],
@@ -169,6 +172,7 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host(),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: ['in-progress', 'shared'],
newGroupKeys: ['shared', 'completed'],
@@ -184,13 +188,14 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host({ sourceKey: 'shared' }),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: ['shared'],
newGroupKeys: ['shared', 'completed'],
});
expect(result.updates.map((patch) => patch.operation)).toEqual([
- { kind: 'prependUnique', entityKey: 'GraphqlSoupItem:task-1' },
+ { kind: 'prependUnique', entityKey: 'GraphqlSoupDocument:task-1' },
]);
});
@@ -198,6 +203,7 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host({ miss: true }),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: ['in-progress'],
newGroupKeys: ['completed'],
@@ -213,6 +219,7 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host({ onInspect }),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: ['in-progress', 'in-progress'],
newGroupKeys: ['in-progress'],
@@ -226,6 +233,7 @@ describe('buildOptimisticGroupedPropertyUpdates', () => {
const result = await buildOptimisticGroupedPropertyUpdates({
host: host(),
entityId: 'task-1',
+ entityType: 'DOCUMENT',
propertyDefinitionId: 'status-def',
oldGroupKeys: [],
newGroupKeys: [],
diff --git a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.ts b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.ts
index 993e272c84..317022f14e 100644
--- a/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.ts
+++ b/apps/web/src/lib/queries/soup/grouped/graphql-optimistic.ts
@@ -8,6 +8,7 @@ import {
update,
} from '@graphql-cache/exchange/optimistic';
import type { CacheHost } from '@graphql-cache/host/types';
+import type { EntityType } from '@service-properties/generated/schemas/entityType';
import {
type GroupedSoupInput,
GroupSoupMembershipDocument,
@@ -19,6 +20,8 @@ import { NOT_SET_GROUP_KEY } from './types';
type BuildArgs = {
host: CacheHost;
entityId: string;
+ /** Properties-service entity kind, used to key the normalized record. */
+ entityType: EntityType;
propertyDefinitionId: string;
oldGroupKeys: readonly string[];
newGroupKeys: readonly string[];
@@ -26,6 +29,29 @@ type BuildArgs = {
revalidateOnly?: boolean;
};
+/** Cache `__typename` for a properties-service entity kind. */
+function soupEntityTypename(entityType: EntityType): string | undefined {
+ switch (entityType) {
+ case 'DOCUMENT':
+ case 'TASK':
+ return 'GraphqlSoupDocument';
+ case 'CHAT':
+ return 'GraphqlSoupChat';
+ case 'PROJECT':
+ return 'GraphqlSoupProject';
+ case 'THREAD':
+ return 'GraphqlSoupEmailThread';
+ case 'CHANNEL':
+ return 'GraphqlSoupChannel';
+ case 'CALL_RECORD':
+ return 'GraphqlSoupCall';
+ case 'COMPANY':
+ return 'GraphqlSoupCrmCompany';
+ case 'USER':
+ return undefined;
+ }
+}
+
export type OptimisticGroupedPropertyUpdates = {
updates: OptimisticUpdate[];
revalidations: QueryRevalidation[];
@@ -125,7 +151,11 @@ export async function buildOptimisticGroupedPropertyUpdates(
);
const { removed, added } = changes;
const updates: OptimisticUpdate[] = [];
- const itemEntityKey = `GraphqlSoupItem:${args.entityId}`;
+ const soupTypename = soupEntityTypename(args.entityType);
+ // Kinds without a Soup entity record cannot be optimistically moved;
+ // membership converges through revalidation instead.
+ if (!soupTypename) return { updates: [], revalidations };
+ const itemEntityKey = `${soupTypename}:${args.entityId}`;
for (const pages of views.values()) {
const sourceGroupKeys = removed.length > 0 ? removed : args.oldGroupKeys;
const sourcePages = pages.filter((page) =>
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts b/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
index cd079eeda8..51b15a1011 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
@@ -158,6 +158,9 @@ export function getGraphqlSoupCacheHost(): CacheHost | undefined {
return cachedCacheHost;
}
+/** Shared entity GraphQL client used by both Soup queries and mutations. */
+export const getEntityGraphqlClient = getGraphqlSoupClient;
+
export type GraphqlSoupInput = SoupInput;
export type GraphqlSoupInitialInput = SoupInitialInput;
export type GraphqlGroupedSoupInput = GroupedSoupInput;
@@ -173,7 +176,7 @@ export type GraphqlGroupedSoupPage = {
};
export type GraphqlSoupItem = SoupQuery['user']['soup']['items'][number];
-type GraphqlSoupEntity = GraphqlSoupItem['entity'];
+type GraphqlSoupEntity = GraphqlSoupItem;
type GraphqlProperty = Extract<
GraphqlSoupEntity,
{ __typename: 'GraphqlSoupDocument' }
@@ -262,15 +265,15 @@ function mapGraphqlProperties(properties: GraphqlProperty[]) {
function mapDocumentSubType(subType: GraphqlSoupDocument['subType']) {
if (!subType) return undefined;
- const type = subType.kind.toLowerCase();
- if (type === 'task') {
- return {
+ return match(subType)
+ .with({ __typename: 'GraphqlTaskSubType' }, ({ isCompleted }) => ({
type: 'task' as const,
- is_completed: subType.isCompleted ?? false,
- };
- }
- if (type === 'snippet') return { type: 'snippet' as const };
- return undefined;
+ is_completed: isCompleted,
+ }))
+ .with({ __typename: 'GraphqlSnippetSubType' }, () => ({
+ type: 'snippet' as const,
+ }))
+ .exhaustive();
}
function mapChannelMessage(
@@ -278,14 +281,14 @@ function mapChannelMessage(
) {
if (!message) return message;
return {
- message_id: message.id,
+ message_id: message.messageId,
thread_id: message.threadId ?? undefined,
sender_id: message.senderId,
content: message.content,
created_at: message.createdAt,
updated_at: message.updatedAt,
deleted_at: message.deletedAt ?? undefined,
- mentions: message.mentions,
+ mentions: message.mentions ?? [],
};
}
@@ -317,19 +320,16 @@ function mapGraphqlNotifications(notifications: GraphqlSoupNotification[]) {
}
export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
- const frecency = item.frecencyScore;
- // `is_favorited: false` below: the GraphQL soup surface has no favorites
- // data; the REST `SoupApiItem` shape requires the flag, and nothing
- // consumes it on this path yet.
+ const frecency = item.frecencyScore ?? 0;
- return match(item.entity)
+ return match(item)
.with(
{ __typename: 'GraphqlSoupDocument' },
(entity) =>
({
tag: 'document',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
id: entity.id,
name: entity.documentName,
@@ -353,7 +353,7 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
({
tag: 'chat',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
id: entity.id,
name: entity.chatName,
@@ -375,7 +375,7 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
({
tag: 'project',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
id: entity.id,
name: entity.projectName,
@@ -396,7 +396,7 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
({
tag: 'emailThread',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
id: entity.id,
providerId: entity.providerId ?? undefined,
@@ -454,7 +454,7 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
({
tag: 'channel',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
channel: {
id: entity.id,
@@ -485,17 +485,17 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
}) as SoupApiItem
)
.with(
- { __typename: 'GraphqlSoupChannelThread' },
+ { __typename: 'GraphqlSoupChannelMessage' },
(entity) =>
({
tag: 'channelThread',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
id: entity.id,
attachments: [],
channel_id: entity.channelId,
- content: entity.content,
+ content: entity.content ?? '',
created_at: entity.createdAt,
reactions: [],
sender: {
@@ -504,9 +504,9 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
},
sender_id: entity.senderId,
thread: {
- latest_reply_at: entity.effectiveUpdatedAt,
+ latest_reply_at: entity.effectiveUpdatedAt ?? undefined,
preview: [],
- reply_count: entity.replyCount,
+ reply_count: entity.replyCount ?? 0,
},
updated_at: entity.updatedAt,
notifications: mapGraphqlNotifications(entity.notifications),
@@ -519,7 +519,7 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
({
tag: 'call',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
callId: entity.id,
channelId: entity.channelId,
@@ -549,7 +549,7 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
({
tag: 'crmCompany',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
id: entity.id,
teamId: entity.crmTeamId,
@@ -577,14 +577,14 @@ export function mapGraphqlSoupItem(item: GraphqlSoupItem): SoupApiItem {
({
tag: 'foreignEntity',
frecency_score: frecency,
- is_favorited: false,
+ is_favorited: entity.isFavorited,
data: {
id: entity.id,
foreignEntityId: entity.foreignEntityId,
foreignEntitySource: entity.foreignEntitySource,
storedForId: entity.storedForId,
storedForAuthEntity: entity.storedForAuthEntity,
- metadata: entity.metadata,
+ metadata: entity.sourceMetadata,
createdAt: entity.createdAt,
updatedAt: entity.updatedAt,
notifications: mapGraphqlNotifications(entity.notifications),
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/entity-mutations.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/entity-mutations.graphql
new file mode 100644
index 0000000000..fd66868c3f
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/entity-mutations.graphql
@@ -0,0 +1,71 @@
+fragment EntityMutationRefFields on GraphqlEntity {
+ entityType
+ id
+}
+
+fragment EntityMutationResultFields on GraphqlEntityMutationResult {
+ __typename
+ ... on GraphqlMutationSuccess {
+ affectedEntities {
+ ...EntityMutationRefFields
+ }
+ }
+ ... on GraphqlMutationError {
+ errorCode
+ message
+ }
+}
+
+fragment EntityMutationPayloadFields on EntityMutationPayload {
+ results {
+ ...EntityMutationResultFields
+ }
+}
+
+mutation RenameEntities($inputs: [RenameEntityInput!]!) {
+ renameEntities(inputs: $inputs) {
+ ...EntityMutationPayloadFields
+ }
+}
+
+mutation MoveEntities($inputs: [MoveEntityInput!]!) {
+ moveEntities(inputs: $inputs) {
+ ...EntityMutationPayloadFields
+ }
+}
+
+mutation UpdateEntitySharePolicies($inputs: [UpdateEntitySharePolicyInput!]!) {
+ updateEntitySharePolicies(inputs: $inputs) {
+ ...EntityMutationPayloadFields
+ }
+}
+
+mutation TrashEntities($entities: [EntityRefInput!]!) {
+ trashEntities(entities: $entities) {
+ ...EntityMutationPayloadFields
+ }
+}
+
+mutation RestoreEntities($entities: [EntityRefInput!]!) {
+ restoreEntities(entities: $entities) {
+ ...EntityMutationPayloadFields
+ }
+}
+
+mutation DeleteEntitiesPermanently($entities: [EntityRefInput!]!) {
+ deleteEntitiesPermanently(entities: $entities) {
+ ...EntityMutationPayloadFields
+ }
+}
+
+mutation DuplicateEntities($inputs: [DuplicateEntityInput!]!) {
+ duplicateEntities(inputs: $inputs) {
+ ...EntityMutationPayloadFields
+ }
+}
+
+mutation SetEntityFavorite($entity: EntityRefInput!, $favorite: Boolean!) {
+ setEntityFavorite(entity: $entity, favorite: $favorite) {
+ ...EntityMutationResultFields
+ }
+}
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 31b25c1ec1..ae4f316f14 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,42 @@ 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-specific entry inside the otherwise common share-policy model. */
+export type ChannelSharePolicyInput = {
+ /** Access level for add/replace operations. */
+ accessLevel?: GraphqlEntityAccessLevel | null | undefined;
+ /** Channel receiving or losing access. */
+ channelId: string | number;
+ /** Requested change. */
+ operation: GraphqlSharePolicyOperation;
+};
+
+/** One entity duplication in a batch. */
+export type DuplicateEntityInput = {
+ /** Optional display name for the new entity. */
+ displayName?: string | null | undefined;
+ /** Source entity to duplicate. */
+ entity: EntityRefInput;
+};
+
+/** Canonical entity reference accepted by unified mutations. */
+export type EntityRefInput = {
+ /** Entity identifier in that kind's canonical namespace. */
+ id: string | number;
+ /** Entity kind. */
+ type: GraphqlEntityType;
+};
+
+/** Shared public/channel share-policy update. */
+export type EntitySharePolicyInput = {
+ /** Channel access entries to add, remove, or replace. */
+ channelSharePermissions?: Array<ChannelSharePolicyInput> | null | undefined;
+ /** Whether public access should be enabled. */
+ isPublic?: boolean | null | undefined;
+ /** Public access level when public access is enabled. */
+ publicAccessLevel?: GraphqlEntityAccessLevel | null | undefined;
+};
+
/** The two operands of a recursive `CallFilterExpr` binary expression. */
export type GraphqlCallBinaryExpr = {
/** The left-hand expression. */
@@ -369,6 +405,17 @@ export type GraphqlEmailView =
/** The starred option. */
| 'STARRED';
+/** Item access level resolved for the current viewer. */
+export type GraphqlEntityAccessLevel =
+ /** Comment access. */
+ | 'COMMENT'
+ /** Edit access. */
+ | 'EDIT'
+ /** Owner access. */
+ | 'OWNER'
+ /** Read-only access. */
+ | 'VIEW';
+
/** GraphQL input mirroring `item_filters::ast::EntityFilterAst`. */
export type GraphqlEntityFilterAst = {
/** The call filter to apply. */
@@ -393,6 +440,21 @@ export type GraphqlEntityFilterAst = {
propertiesFilter?: GraphqlPropertiesExpr | null | undefined;
};
+/** Stable machine-readable mutation error code. */
+export type GraphqlEntityMutationErrorCode =
+ /** Mutation conflicts with current state. */
+ | 'CONFLICT'
+ /** Actor lacks the required capability. */
+ | 'FORBIDDEN'
+ /** Internal failure. */
+ | 'INTERNAL'
+ /** Input violates a domain constraint. */
+ | 'INVALID_INPUT'
+ /** Entity was not found. */
+ | 'NOT_FOUND'
+ /** Operation is unavailable for the requested entity kind. */
+ | 'UNSUPPORTED_OPERATION';
+
/** Input identifying an entity referenced by a property value. */
export type GraphqlEntityReferenceInput = {
/** Identifier of the referenced entity. */
@@ -403,6 +465,35 @@ export type GraphqlEntityReferenceInput = {
specificMessageId?: string | number | null | undefined;
};
+/** Canonical entity types accepted by cross-entity APIs. */
+export type GraphqlEntityType =
+ /** Call entity. */
+ | 'CALL'
+ /** Channel entity. */
+ | 'CHANNEL'
+ /** Channel message entity. */
+ | 'CHANNEL_MESSAGE'
+ /** Chat entity. */
+ | 'CHAT'
+ /** CRM company entity. */
+ | 'CRM_COMPANY'
+ /** CRM contact entity. */
+ | 'CRM_CONTACT'
+ /** Document entity. */
+ | 'DOCUMENT'
+ /** Email thread entity. */
+ | 'EMAIL_THREAD'
+ /** Foreign entity. */
+ | 'FOREIGN_ENTITY'
+ /** Project entity. */
+ | 'PROJECT'
+ /** Static file entity. */
+ | 'STATIC_FILE'
+ /** Team entity. */
+ | 'TEAM'
+ /** User entity. */
+ | 'USER';
+
/** The two operands of a recursive `ForeignEntityFilterExpr` binary expression. */
export type GraphqlForeignEntityBinaryExpr = {
/** The left-hand expression. */
@@ -616,6 +707,15 @@ export type GraphqlSetPropertyValue =
| { boolean?: never; date?: never; entityReference?: never; link?: never; multiEntityReference?: never; multiLink?: never; multiSelectOption?: never; number?: never; selectOption?: never; /** A string value. */
string: string; };
+/** Operation applied to one channel share-policy entry. */
+export type GraphqlSharePolicyOperation =
+ /** Add an entry. */
+ | 'ADD'
+ /** Remove an entry. */
+ | 'REMOVE'
+ /** Replace an existing entry. */
+ | 'REPLACE';
+
/** GraphQL input representing the shared email filter. */
export type GraphqlSharedEmailFilter =
/** The exclude option. */
@@ -642,14 +742,12 @@ export type GraphqlSoupEntityType =
| 'CALL'
/** Channel entity. */
| 'CHANNEL'
- /** Channel thread entity. */
- | 'CHANNEL_THREAD'
+ /** Channel message entity. */
+ | 'CHANNEL_MESSAGE'
/** Chat entity. */
| 'CHAT'
/** CRM company entity. */
| 'CRM_COMPANY'
- /** CRM contact entity. */
- | 'CRM_CONTACT'
/** Document entity. */
| 'DOCUMENT'
/** Email thread entity. */
@@ -657,13 +755,7 @@ export type GraphqlSoupEntityType =
/** Foreign entity. */
| 'FOREIGN_ENTITY'
/** Project entity. */
- | 'PROJECT'
- /** Static file entity. */
- | 'STATIC_FILE'
- /** Team entity. */
- | 'TEAM'
- /** User entity. */
- | 'USER';
+ | 'PROJECT';
/** Input for continuing a single grouped Soup bin. */
export type GroupedSoupContinuationInput = {
@@ -694,6 +786,22 @@ export type GroupedSoupInput =
| { continuation?: never; /** Start a new grouped Soup query. */
initial: GroupedSoupInitialInput; };
+/** One entity move in a batch. */
+export type MoveEntityInput = {
+ /** Entity to move. */
+ entity: EntityRefInput;
+ /** Destination project id. Omit or pass null to move to the root. */
+ projectId?: string | number | null | undefined;
+};
+
+/** One entity rename in a batch. */
+export type RenameEntityInput = {
+ /** New user-visible display name. */
+ displayName: string;
+ /** Entity to rename. */
+ entity: EntityRefInput;
+};
+
/** Input for assigning or updating an entity property. */
export type SetEntityPropertyInput = {
/** Identifier of the entity receiving the property. */
@@ -740,152 +848,135 @@ export type SoupInput =
| { continuation?: never; /** Start a new Soup query. */
initial: SoupInitialInput; };
-export type GroupSoupMembershipQueryVariables = Exact<{
- input: GroupedSoupInput;
+/** One share-policy update in a batch. */
+export type UpdateEntitySharePolicyInput = {
+ /** Entity whose share policy should change. */
+ entity: EntityRefInput;
+ /** New public/channel policy values. */
+ policy: EntitySharePolicyInput;
+};
+
+export type EntityMutationRefFieldsFragment = { entityType: GraphqlEntityType, id: string };
+
+type EntityMutationResultFields_GraphqlMutationError_Fragment = { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string };
+
+type EntityMutationResultFields_GraphqlMutationSuccess_Fragment = { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> };
+
+export type EntityMutationResultFieldsFragment =
+ | EntityMutationResultFields_GraphqlMutationError_Fragment
+ | EntityMutationResultFields_GraphqlMutationSuccess_Fragment
+;
+
+export type EntityMutationPayloadFieldsFragment = { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > };
+
+export type RenameEntitiesMutationVariables = Exact<{
+ inputs: Array<RenameEntityInput> | RenameEntityInput;
}>;
-export type GroupSoupMembershipQuery = { user: { id: string, groupSoup: { bins: Array<{ key: string, totalCount: number, nextCursor: string | null, items: Array<{ id: string }> }> } } };
+export type RenameEntitiesMutation = { renameEntities: { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > } };
-export type GroupSoupQueryVariables = Exact<{
- input: GroupedSoupInput;
+export type MoveEntitiesMutationVariables = Exact<{
+ inputs: Array<MoveEntityInput> | MoveEntityInput;
+}>;
+
+
+export type MoveEntitiesMutation = { moveEntities: { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > } };
+
+export type UpdateEntitySharePoliciesMutationVariables = Exact<{
+ inputs: Array<UpdateEntitySharePolicyInput> | UpdateEntitySharePolicyInput;
+}>;
+
+
+export type UpdateEntitySharePoliciesMutation = { updateEntitySharePolicies: { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > } };
+
+export type TrashEntitiesMutationVariables = Exact<{
+ entities: Array<EntityRefInput> | EntityRefInput;
+}>;
+
+
+export type TrashEntitiesMutation = { trashEntities: { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > } };
+
+export type RestoreEntitiesMutationVariables = Exact<{
+ entities: Array<EntityRefInput> | EntityRefInput;
}>;
-export type GroupSoupQuery = { user: { id: string, groupSoup: { bins: Array<{ key: string, totalCount: number, nextCursor: string | null, items: Array<{ id: string, entityType: GraphqlSoupEntityType, frecencyScore: number, entity:
- | { __typename: 'GraphqlSoupCall', id: string, channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupChannel', id: string, channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, isParticipant: boolean, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> }
- | { __typename: 'GraphqlSoupChannelThread', id: string, channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, 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 }> }
- | { __typename: 'GraphqlSoupChat', id: string, ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupCrmCompany', id: string, description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupDocument', id: string, ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, documentName: string, subType: { kind: string, isCompleted: boolean | null } | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupEmailThread', id: string, providerId: string | null, ownerId: string, inboxVisible: boolean, linkId: string | null, snippet: string | null, senderEmail: string | null, senderName: string | null, senderPhotoUrl: string | null, isRead: boolean, isDraft: boolean, isImportant: boolean, projectId: string | null, sortTs: string, createdAt: string, updatedAt: string, viewedAt: string | null, emailName: string | null, participants: Array<{ id: string, linkId: string, name: string | null, email: string | null, sfsPhotoUrl: string | null }>, attachments: Array<{ id: string, messageId: string, providerAttachmentId: string | null, filename: string | null, mimeType: string | null, sizeBytes: number | null, contentId: string | null, createdAt: string }>, labels: Array<{ id: string, linkId: string, providerLabelId: string, name: string, createdAt: string, messageListVisibility: string, labelListVisibility: string, type: string }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }>, latestContentMessage: { __typename: 'GraphqlSoupEmailMessage', id: string, threadId: string, linkId: string, subject: string | null, snippet: string | null, internalDateTs: string | null, sentAt: string | null, isRead: boolean, isStarred: boolean, isSent: boolean, hasAttachments: boolean, bodyParsed: string | null, bodyText: string | null, bodyHtmlSanitized: string | null, bodyMacro: string | null, bodyReplyless: string | null, createdAt: string, updatedAt: string, from: { email: string, name: string | null, photoUrl: string | null } | null, to: Array<{ email: string, name: string | null, photoUrl: string | null }>, cc: Array<{ email: string, name: string | null, photoUrl: string | null }>, bcc: Array<{ email: string, name: string | null, photoUrl: string | null }>, labels: Array<{ providerLabelId: string, name: string }> } | null }
- | { __typename: 'GraphqlSoupForeignEntity', id: string, foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, metadata: unknown, createdAt: string, updatedAt: string, 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 }> }
- | { __typename: 'GraphqlSoupProject', id: string, ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- }> }> } } };
-
-export type GraphqlHistoryItemFieldsFragment = { id: string, entityType: GraphqlSoupEntityType, frecencyScore: number, entity:
- | { __typename: 'GraphqlSoupCall', id: string, channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupChannel', id: string, channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> }
- | { __typename: 'GraphqlSoupChannelThread', id: string, channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, 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 }> }
- | { __typename: 'GraphqlSoupChat', id: string, ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupCrmCompany', id: string, description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupDocument', id: string, ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, documentName: string, subType: { kind: string, isCompleted: boolean | null } | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupEmailThread', attachmentCount: number, participantCount: number }
- | { __typename: 'GraphqlSoupForeignEntity', id: string, foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, metadata: unknown, createdAt: string, updatedAt: string, 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 }> }
- | { __typename: 'GraphqlSoupProject', id: string, ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
+export type RestoreEntitiesMutation = { restoreEntities: { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > } };
+
+export type DeleteEntitiesPermanentlyMutationVariables = Exact<{
+ entities: Array<EntityRefInput> | EntityRefInput;
+}>;
+
+
+export type DeleteEntitiesPermanentlyMutation = { deleteEntitiesPermanently: { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > } };
+
+export type DuplicateEntitiesMutationVariables = Exact<{
+ inputs: Array<DuplicateEntityInput> | DuplicateEntityInput;
+}>;
+
+
+export type DuplicateEntitiesMutation = { duplicateEntities: { results: Array<
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
+ > } };
+
+export type SetEntityFavoriteMutationVariables = Exact<{
+ entity: EntityRefInput;
+ favorite: boolean;
+}>;
+
+
+export type SetEntityFavoriteMutation = { setEntityFavorite:
+ | { __typename: 'GraphqlMutationError', errorCode: GraphqlEntityMutationErrorCode, message: string }
+ | { __typename: 'GraphqlMutationSuccess', affectedEntities: Array<{ entityType: GraphqlEntityType, id: string }> }
};
-export type SetEntityPropertyMutationVariables = Exact<{
- input: SetEntityPropertyInput;
+export type GroupSoupMembershipQueryVariables = Exact<{
+ input: GroupedSoupInput;
}>;
-export type SetEntityPropertyMutation = { setEntityProperty: { id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
- | { __typename: 'GraphqlStringPropertyValue', stringValue: string }
- | null } };
+export type GroupSoupMembershipQuery = { user: { id: string, groupSoup: { bins: Array<{ key: string, totalCount: number, nextCursor: string | null, items: Array<
+ | { __typename: 'GraphqlSoupCall', id: string }
+ | { __typename: 'GraphqlSoupChannel', id: string }
+ | { __typename: 'GraphqlSoupChannelMessage', id: string }
+ | { __typename: 'GraphqlSoupChat', id: string }
+ | { __typename: 'GraphqlSoupCrmCompany', id: string }
+ | { __typename: 'GraphqlSoupDocument', id: string }
+ | { __typename: 'GraphqlSoupEmailThread', id: string }
+ | { __typename: 'GraphqlSoupForeignEntity', id: string }
+ | { __typename: 'GraphqlSoupProject', id: string }
+ > }> } } };
-export type SoupQueryVariables = Exact<{
- input: SoupInput;
+export type GroupSoupQueryVariables = Exact<{
+ input: GroupedSoupInput;
}>;
-export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null, hasMore: boolean, items: Array<{ id: string, entityType: GraphqlSoupEntityType, frecencyScore: number, entity:
- | { __typename: 'GraphqlSoupCall', id: string, channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+export type GroupSoupQuery = { user: { id: string, groupSoup: { bins: Array<{ key: string, totalCount: number, nextCursor: string | null, items: Array<
+ | { __typename: 'GraphqlSoupCall', channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
| { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
| { __typename: 'GraphqlDatePropertyValue', dateValue: string }
| { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
@@ -894,9 +985,9 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,
| { __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 }> }
- | { __typename: 'GraphqlSoupChannel', id: string, channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, isParticipant: boolean, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> }
- | { __typename: 'GraphqlSoupChannelThread', id: string, channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, 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 }> }
- | { __typename: 'GraphqlSoupChat', id: string, ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlSoupChannel', channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, isParticipant: boolean, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> }
+ | { __typename: 'GraphqlSoupChannelMessage', channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> }
+ | { __typename: 'GraphqlSoupChat', ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
| { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
| { __typename: 'GraphqlDatePropertyValue', dateValue: string }
| { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
@@ -905,7 +996,7 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,
| { __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 }> }
- | { __typename: 'GraphqlSoupCrmCompany', id: string, description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlSoupCrmCompany', description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
| { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
| { __typename: 'GraphqlDatePropertyValue', dateValue: string }
| { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
@@ -914,7 +1005,10 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,
| { __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 }> }
- | { __typename: 'GraphqlSoupDocument', id: string, ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, documentName: string, subType: { kind: string, isCompleted: boolean | null } | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:
+ | { __typename: 'GraphqlSnippetSubType' }
+ | { __typename: 'GraphqlTaskSubType', isCompleted: boolean }
+ | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
| { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
| { __typename: 'GraphqlDatePropertyValue', dateValue: string }
| { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
@@ -923,7 +1017,7 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,
| { __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 }> }
- | { __typename: 'GraphqlSoupEmailThread', id: string, providerId: string | null, ownerId: string, inboxVisible: boolean, linkId: string | null, snippet: string | null, senderEmail: string | null, senderName: string | null, senderPhotoUrl: string | null, isRead: boolean, isDraft: boolean, isImportant: boolean, projectId: string | null, sortTs: string, createdAt: string, updatedAt: string, viewedAt: string | null, emailName: string | null, participants: Array<{ id: string, linkId: string, name: string | null, email: string | null, sfsPhotoUrl: string | null }>, attachments: Array<{ id: string, messageId: string, providerAttachmentId: string | null, filename: string | null, mimeType: string | null, sizeBytes: number | null, contentId: string | null, createdAt: string }>, labels: Array<{ id: string, linkId: string, providerLabelId: string, name: string, createdAt: string, messageListVisibility: string, labelListVisibility: string, type: string }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlSoupEmailThread', providerId: string | null, ownerId: string, inboxVisible: boolean, linkId: string | null, snippet: string | null, senderEmail: string | null, senderName: string | null, senderPhotoUrl: string | null, isRead: boolean, isDraft: boolean, isImportant: boolean, projectId: string | null, sortTs: string, createdAt: string, updatedAt: string, viewedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, emailName: string | null, participants: Array<{ id: string, linkId: string, name: string | null, email: string | null, sfsPhotoUrl: string | null }>, attachments: Array<{ id: string, messageId: string, providerAttachmentId: string | null, filename: string | null, mimeType: string | null, sizeBytes: number | null, contentId: string | null, createdAt: string }>, labels: Array<{ id: string, linkId: string, providerLabelId: string, name: string, createdAt: string, messageListVisibility: string, labelListVisibility: string, type: string }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
| { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
| { __typename: 'GraphqlDatePropertyValue', dateValue: string }
| { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
@@ -931,9 +1025,9 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,
| { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
| { __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 }>, latestContentMessage: { __typename: 'GraphqlSoupEmailMessage', id: string, threadId: string, linkId: string, subject: string | null, snippet: string | null, internalDateTs: string | null, sentAt: string | null, isRead: boolean, isStarred: boolean, isSent: boolean, hasAttachments: boolean, bodyParsed: string | null, bodyText: string | null, bodyHtmlSanitized: string | null, bodyMacro: string | null, bodyReplyless: string | null, createdAt: string, updatedAt: string, from: { email: string, name: string | null, photoUrl: string | null } | null, to: Array<{ email: string, name: string | null, photoUrl: string | null }>, cc: Array<{ email: string, name: string | null, photoUrl: string | null }>, bcc: Array<{ email: string, name: string | null, photoUrl: string | null }>, labels: Array<{ providerLabelId: string, name: string }> } | null }
- | { __typename: 'GraphqlSoupForeignEntity', id: string, foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, metadata: unknown, createdAt: string, updatedAt: string, 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 }> }
- | { __typename: 'GraphqlSoupProject', id: string, ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | null }>, latestContentMessage: { __typename: 'GraphqlSoupEmailMessage', id: string, threadId: string, linkId: string, subject: string | null, snippet: string | null, internalDateTs: string | null, sentAt: string | null, isRead: boolean, isStarred: boolean, isSent: boolean, hasAttachments: boolean, bodyParsed: string | null, bodyText: string | null, bodyHtmlSanitized: string | null, bodyMacro: string | null, bodyReplyless: string | null, createdAt: string, updatedAt: string, from: { email: string, name: string | null, photoUrl: string | null } | null, to: Array<{ email: string, name: string | null, photoUrl: string | null }>, cc: Array<{ email: string, name: string | null, photoUrl: string | null }>, bcc: Array<{ email: string, name: string | null, photoUrl: string | null }>, labels: Array<{ providerLabelId: string, name: 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 }> }
+ | { __typename: 'GraphqlSoupForeignEntity', foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, sourceMetadata: unknown, createdAt: string, updatedAt: string, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> }
+ | { __typename: 'GraphqlSoupProject', ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
| { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
| { __typename: 'GraphqlDatePropertyValue', dateValue: string }
| { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
@@ -942,67 +1036,274 @@ export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null,
| { __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 }> }
- }> } } };
-
-export type SoupItemFieldsFragment = { id: string, entityType: GraphqlSoupEntityType, frecencyScore: number, entity:
- | { __typename: 'GraphqlSoupCall', id: string, channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupChannel', id: string, channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, isParticipant: boolean, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> }
- | { __typename: 'GraphqlSoupChannelThread', id: string, channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, 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 }> }
- | { __typename: 'GraphqlSoupChat', id: string, ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupCrmCompany', id: string, description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupDocument', id: string, ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, documentName: string, subType: { kind: string, isCompleted: boolean | null } | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- | { __typename: 'GraphqlSoupEmailThread', id: string, providerId: string | null, ownerId: string, inboxVisible: boolean, linkId: string | null, snippet: string | null, senderEmail: string | null, senderName: string | null, senderPhotoUrl: string | null, isRead: boolean, isDraft: boolean, isImportant: boolean, projectId: string | null, sortTs: string, createdAt: string, updatedAt: string, viewedAt: string | null, emailName: string | null, participants: Array<{ id: string, linkId: string, name: string | null, email: string | null, sfsPhotoUrl: string | null }>, attachments: Array<{ id: string, messageId: string, providerAttachmentId: string | null, filename: string | null, mimeType: string | null, sizeBytes: number | null, contentId: string | null, createdAt: string }>, labels: Array<{ id: string, linkId: string, providerLabelId: string, name: string, createdAt: string, messageListVisibility: string, labelListVisibility: string, type: string }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }>, latestContentMessage: { __typename: 'GraphqlSoupEmailMessage', id: string, threadId: string, linkId: string, subject: string | null, snippet: string | null, internalDateTs: string | null, sentAt: string | null, isRead: boolean, isStarred: boolean, isSent: boolean, hasAttachments: boolean, bodyParsed: string | null, bodyText: string | null, bodyHtmlSanitized: string | null, bodyMacro: string | null, bodyReplyless: string | null, createdAt: string, updatedAt: string, from: { email: string, name: string | null, photoUrl: string | null } | null, to: Array<{ email: string, name: string | null, photoUrl: string | null }>, cc: Array<{ email: string, name: string | null, photoUrl: string | null }>, bcc: Array<{ email: string, name: string | null, photoUrl: string | null }>, labels: Array<{ providerLabelId: string, name: string }> } | null }
- | { __typename: 'GraphqlSoupForeignEntity', id: string, foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, metadata: unknown, createdAt: string, updatedAt: string, 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 }> }
- | { __typename: 'GraphqlSoupProject', id: string, ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
- | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
- | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
- | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
- | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
- | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
- | { __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 }> }
- };
+ > }> } } };
+
+type GraphqlHistoryItemFields_GraphqlSoupCall_Fragment = { __typename: 'GraphqlSoupCall', id: string, channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, entityType: GraphqlSoupEntityType, frecencyScore: number | null, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type GraphqlHistoryItemFields_GraphqlSoupChannel_Fragment = { __typename: 'GraphqlSoupChannel', id: string, channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, entityType: GraphqlSoupEntityType, frecencyScore: number | null, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> };
+
+type GraphqlHistoryItemFields_GraphqlSoupChannelMessage_Fragment = { __typename: 'GraphqlSoupChannelMessage', id: string, channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, entityType: GraphqlSoupEntityType, frecencyScore: number | 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 }> };
+
+type GraphqlHistoryItemFields_GraphqlSoupChat_Fragment = { __typename: 'GraphqlSoupChat', id: string, ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, entityType: GraphqlSoupEntityType, frecencyScore: number | null, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type GraphqlHistoryItemFields_GraphqlSoupCrmCompany_Fragment = { __typename: 'GraphqlSoupCrmCompany', id: string, description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, entityType: GraphqlSoupEntityType, frecencyScore: number | null, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type GraphqlHistoryItemFields_GraphqlSoupDocument_Fragment = { __typename: 'GraphqlSoupDocument', id: string, ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, entityType: GraphqlSoupEntityType, frecencyScore: number | null, documentName: string, subType:
+ | { __typename: 'GraphqlSnippetSubType' }
+ | { __typename: 'GraphqlTaskSubType', isCompleted: boolean }
+ | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type GraphqlHistoryItemFields_GraphqlSoupEmailThread_Fragment = { __typename: 'GraphqlSoupEmailThread', attachmentCount: number, participantCount: number, id: string, entityType: GraphqlSoupEntityType, frecencyScore: number | null };
+
+type GraphqlHistoryItemFields_GraphqlSoupForeignEntity_Fragment = { __typename: 'GraphqlSoupForeignEntity', id: string, foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, sourceMetadata: unknown, createdAt: string, updatedAt: string, entityType: GraphqlSoupEntityType, frecencyScore: number | 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 }> };
+
+type GraphqlHistoryItemFields_GraphqlSoupProject_Fragment = { __typename: 'GraphqlSoupProject', id: string, ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, entityType: GraphqlSoupEntityType, frecencyScore: number | null, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+export type GraphqlHistoryItemFieldsFragment =
+ | GraphqlHistoryItemFields_GraphqlSoupCall_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupChannel_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupChannelMessage_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupChat_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupCrmCompany_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupDocument_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupEmailThread_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupForeignEntity_Fragment
+ | GraphqlHistoryItemFields_GraphqlSoupProject_Fragment
+;
+
+export type SetEntityPropertyMutationVariables = Exact<{
+ input: SetEntityPropertyInput;
+}>;
+
+
+export type SetEntityPropertyMutation = { setEntityProperty: { id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
+ | { __typename: 'GraphqlStringPropertyValue', stringValue: string }
+ | null } };
+
+export type SoupQueryVariables = Exact<{
+ input: SoupInput;
+}>;
+
+
+export type SoupQuery = { user: { id: string, soup: { nextCursor: string | null, hasMore: boolean, items: Array<
+ | { __typename: 'GraphqlSoupCall', channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> }
+ | { __typename: 'GraphqlSoupChannel', channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, isParticipant: boolean, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> }
+ | { __typename: 'GraphqlSoupChannelMessage', channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> }
+ | { __typename: 'GraphqlSoupChat', ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> }
+ | { __typename: 'GraphqlSoupCrmCompany', description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> }
+ | { __typename: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:
+ | { __typename: 'GraphqlSnippetSubType' }
+ | { __typename: 'GraphqlTaskSubType', isCompleted: boolean }
+ | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> }
+ | { __typename: 'GraphqlSoupEmailThread', providerId: string | null, ownerId: string, inboxVisible: boolean, linkId: string | null, snippet: string | null, senderEmail: string | null, senderName: string | null, senderPhotoUrl: string | null, isRead: boolean, isDraft: boolean, isImportant: boolean, projectId: string | null, sortTs: string, createdAt: string, updatedAt: string, viewedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, emailName: string | null, participants: Array<{ id: string, linkId: string, name: string | null, email: string | null, sfsPhotoUrl: string | null }>, attachments: Array<{ id: string, messageId: string, providerAttachmentId: string | null, filename: string | null, mimeType: string | null, sizeBytes: number | null, contentId: string | null, createdAt: string }>, labels: Array<{ id: string, linkId: string, providerLabelId: string, name: string, createdAt: string, messageListVisibility: string, labelListVisibility: string, type: string }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
+ | { __typename: 'GraphqlStringPropertyValue', stringValue: string }
+ | null }>, latestContentMessage: { __typename: 'GraphqlSoupEmailMessage', id: string, threadId: string, linkId: string, subject: string | null, snippet: string | null, internalDateTs: string | null, sentAt: string | null, isRead: boolean, isStarred: boolean, isSent: boolean, hasAttachments: boolean, bodyParsed: string | null, bodyText: string | null, bodyHtmlSanitized: string | null, bodyMacro: string | null, bodyReplyless: string | null, createdAt: string, updatedAt: string, from: { email: string, name: string | null, photoUrl: string | null } | null, to: Array<{ email: string, name: string | null, photoUrl: string | null }>, cc: Array<{ email: string, name: string | null, photoUrl: string | null }>, bcc: Array<{ email: string, name: string | null, photoUrl: string | null }>, labels: Array<{ providerLabelId: string, name: 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 }> }
+ | { __typename: 'GraphqlSoupForeignEntity', foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, sourceMetadata: unknown, createdAt: string, updatedAt: string, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> }
+ | { __typename: 'GraphqlSoupProject', ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> }
+ > } } };
+
+type SoupItemFields_GraphqlSoupCall_Fragment = { __typename: 'GraphqlSoupCall', channelId: string, channelName: string | null, createdBy: string, customName: string | null, summary: string | null, startedAt: string, endedAt: string | null, durationMs: number | null, isActive: boolean, status: string, attended: boolean, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, participants: Array<{ userId: string, joinedAt: string, leftAt: string | null }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type SoupItemFields_GraphqlSoupChannel_Fragment = { __typename: 'GraphqlSoupChannel', channelType: string, ownerId: string, organizationId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, interactedAt: string | null, isParticipant: boolean, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, channelName: string | null, channelTeamId: string | null, participants: Array<{ channelId: string, userId: string, role: string, joinedAt: string, leftAt: string | null }>, latestMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> } | null, latestNonThreadMessage: { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<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 }> };
+
+type SoupItemFields_GraphqlSoupChannelMessage_Fragment = { __typename: 'GraphqlSoupChannelMessage', channelId: string, senderId: string, content: string, createdAt: string, updatedAt: string, effectiveUpdatedAt: string, replyCount: number, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupItemFields_GraphqlSoupChat_Fragment = { __typename: 'GraphqlSoupChat', ownerId: string, projectId: string | null, isPersistent: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, chatName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type SoupItemFields_GraphqlSoupCrmCompany_Fragment = { __typename: 'GraphqlSoupCrmCompany', description: string | null, emailSync: boolean, hidden: boolean, createdAt: string, updatedAt: string, viewedAt: string | null, domains: Array<string>, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, crmTeamId: string, crmCompanyName: string | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type SoupItemFields_GraphqlSoupDocument_Fragment = { __typename: 'GraphqlSoupDocument', ownerId: string, fileType: string | null, projectId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, documentName: string, subType:
+ | { __typename: 'GraphqlSnippetSubType' }
+ | { __typename: 'GraphqlTaskSubType', isCompleted: boolean }
+ | null, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+type SoupItemFields_GraphqlSoupEmailThread_Fragment = { __typename: 'GraphqlSoupEmailThread', providerId: string | null, ownerId: string, inboxVisible: boolean, linkId: string | null, snippet: string | null, senderEmail: string | null, senderName: string | null, senderPhotoUrl: string | null, isRead: boolean, isDraft: boolean, isImportant: boolean, projectId: string | null, sortTs: string, createdAt: string, updatedAt: string, viewedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, emailName: string | null, participants: Array<{ id: string, linkId: string, name: string | null, email: string | null, sfsPhotoUrl: string | null }>, attachments: Array<{ id: string, messageId: string, providerAttachmentId: string | null, filename: string | null, mimeType: string | null, sizeBytes: number | null, contentId: string | null, createdAt: string }>, labels: Array<{ id: string, linkId: string, providerLabelId: string, name: string, createdAt: string, messageListVisibility: string, labelListVisibility: string, type: string }>, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __typename: 'GraphqlSelectOptionPropertyValue', optionIds: Array<string> }
+ | { __typename: 'GraphqlStringPropertyValue', stringValue: string }
+ | null }>, latestContentMessage: { __typename: 'GraphqlSoupEmailMessage', id: string, threadId: string, linkId: string, subject: string | null, snippet: string | null, internalDateTs: string | null, sentAt: string | null, isRead: boolean, isStarred: boolean, isSent: boolean, hasAttachments: boolean, bodyParsed: string | null, bodyText: string | null, bodyHtmlSanitized: string | null, bodyMacro: string | null, bodyReplyless: string | null, createdAt: string, updatedAt: string, from: { email: string, name: string | null, photoUrl: string | null } | null, to: Array<{ email: string, name: string | null, photoUrl: string | null }>, cc: Array<{ email: string, name: string | null, photoUrl: string | null }>, bcc: Array<{ email: string, name: string | null, photoUrl: string | null }>, labels: Array<{ providerLabelId: string, name: 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 }> };
+
+type SoupItemFields_GraphqlSoupForeignEntity_Fragment = { __typename: 'GraphqlSoupForeignEntity', foreignEntityId: string, foreignEntitySource: string, storedForId: string, storedForAuthEntity: string, sourceMetadata: unknown, createdAt: string, updatedAt: string, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupItemFields_GraphqlSoupProject_Fragment = { __typename: 'GraphqlSoupProject', ownerId: string, parentId: string | null, createdAt: string, updatedAt: string, viewedAt: string | null, deletedAt: string | null, frecencyScore: number | null, id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, projectName: string, properties: Array<{ id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
+ | { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
+ | { __typename: 'GraphqlDatePropertyValue', dateValue: string }
+ | { __typename: 'GraphqlEntityReferencePropertyValue', references: Array<{ entityId: string, entityType: GraphqlPropertyEntityType, specificMessageId: string | null }> }
+ | { __typename: 'GraphqlLinkPropertyValue', urls: Array<string> }
+ | { __typename: 'GraphqlNumberPropertyValue', numberValue: number }
+ | { __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 }> };
+
+export type SoupItemFieldsFragment =
+ | SoupItemFields_GraphqlSoupCall_Fragment
+ | SoupItemFields_GraphqlSoupChannel_Fragment
+ | SoupItemFields_GraphqlSoupChannelMessage_Fragment
+ | SoupItemFields_GraphqlSoupChat_Fragment
+ | SoupItemFields_GraphqlSoupCrmCompany_Fragment
+ | SoupItemFields_GraphqlSoupDocument_Fragment
+ | SoupItemFields_GraphqlSoupEmailThread_Fragment
+ | SoupItemFields_GraphqlSoupForeignEntity_Fragment
+ | SoupItemFields_GraphqlSoupProject_Fragment
+;
+
+type SoupEntityCoreFields_GraphqlSoupCall_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupChannel_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupChannelMessage_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupChat_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupCrmCompany_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupDocument_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupEmailThread_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupForeignEntity_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+type SoupEntityCoreFields_GraphqlSoupProject_Fragment = { id: string, entityType: GraphqlSoupEntityType, displayName: string | null, isFavorited: boolean, 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 }> };
+
+export type SoupEntityCoreFieldsFragment =
+ | SoupEntityCoreFields_GraphqlSoupCall_Fragment
+ | SoupEntityCoreFields_GraphqlSoupChannel_Fragment
+ | SoupEntityCoreFields_GraphqlSoupChannelMessage_Fragment
+ | SoupEntityCoreFields_GraphqlSoupChat_Fragment
+ | SoupEntityCoreFields_GraphqlSoupCrmCompany_Fragment
+ | SoupEntityCoreFields_GraphqlSoupDocument_Fragment
+ | SoupEntityCoreFields_GraphqlSoupEmailThread_Fragment
+ | SoupEntityCoreFields_GraphqlSoupForeignEntity_Fragment
+ | SoupEntityCoreFields_GraphqlSoupProject_Fragment
+;
export type SoupPropertyFieldsFragment = { id: string, propertyDefinitionId: string, displayName: string, dataType: GraphqlPropertyDataType, isMultiSelect: boolean, specificEntityType: GraphqlPropertyEntityType | null, isSystem: boolean, isMetadata: boolean, value:
| { __typename: 'GraphqlBooleanPropertyValue', boolValue: boolean }
@@ -1014,16 +1315,28 @@ export type SoupPropertyFieldsFragment = { id: string, propertyDefinitionId: str
| { __typename: 'GraphqlStringPropertyValue', stringValue: string }
| null };
-export type SoupChannelMessageFieldsFragment = { id: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> };
+export type SoupChannelMessageFieldsFragment = { messageId: string, channelId: string, threadId: string | null, senderId: string, content: string, createdAt: string, updatedAt: string, deletedAt: string | null, mentions: Array<string> };
export type SoupNotificationFieldsFragment = { 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 };
+export const EntityMutationRefFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]} as unknown as DocumentNode<EntityMutationRefFieldsFragment, unknown>;
+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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]} 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":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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 SoupPropertyFieldsFragmentDoc = {"kind":"Document","definitions":[{"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"}}]}}]}}]}}]} as unknown as DocumentNode<SoupPropertyFieldsFragment, unknown>;
export const SoupNotificationFieldsFragmentDoc = {"kind":"Document","definitions":[{"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<SoupNotificationFieldsFragment, unknown>;
-export const SoupChannelMessageFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"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":"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<SoupChannelMessageFieldsFragment, unknown>;
-export const GraphqlHistoryItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GraphqlHistoryItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"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":"kind"}},{"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":"GraphqlSoupChannelThread"}},"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":"metadata"}},{"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":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"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 SoupItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"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":"kind"}},{"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":"id"}},{"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":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}},{"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","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":"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":"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":"GraphqlSoupChannelThread"}},"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":"metadata"}},{"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":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"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<SoupItemFieldsFragment, unknown>;
-export const GroupSoupMembershipDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoupMembership"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"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":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GroupSoupMembershipQuery, GroupSoupMembershipQueryVariables>;
-export const GroupSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"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":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}}]}}]}}]}},{"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":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"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":"GraphqlSoupItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"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":"kind"}},{"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":"id"}},{"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":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}},{"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","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":"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":"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":"GraphqlSoupChannelThread"}},"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":"metadata"}},{"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"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GroupSoupQuery, GroupSoupQueryVariables>;
+export const SoupChannelMessageFieldsFragmentDoc = {"kind":"Document","definitions":[{"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<SoupChannelMessageFieldsFragment, 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 SoupEntityCoreFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"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<SoupEntityCoreFieldsFragment, unknown>;
+export const SoupItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"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":"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"}}]}}]} as unknown as DocumentNode<SoupItemFieldsFragment, unknown>;
+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":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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>;
+export const TrashEntitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"TrashEntities"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"entities"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"EntityRefInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"trashEntities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"entities"},"value":{"kind":"Variable","name":{"kind":"Name","value":"entities"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationPayloadFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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<TrashEntitiesMutation, TrashEntitiesMutationVariables>;
+export const RestoreEntitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RestoreEntities"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"entities"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"EntityRefInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"restoreEntities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"entities"},"value":{"kind":"Variable","name":{"kind":"Name","value":"entities"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationPayloadFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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<RestoreEntitiesMutation, RestoreEntitiesMutationVariables>;
+export const DeleteEntitiesPermanentlyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteEntitiesPermanently"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"entities"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"EntityRefInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteEntitiesPermanently"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"entities"},"value":{"kind":"Variable","name":{"kind":"Name","value":"entities"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationPayloadFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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<DeleteEntitiesPermanentlyMutation, DeleteEntitiesPermanentlyMutationVariables>;
+export const DuplicateEntitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DuplicateEntities"},"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":"DuplicateEntityInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"duplicateEntities"},"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":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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<DuplicateEntitiesMutation, DuplicateEntitiesMutationVariables>;
+export const SetEntityFavoriteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetEntityFavorite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"entity"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"EntityRefInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"favorite"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setEntityFavorite"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"entity"},"value":{"kind":"Variable","name":{"kind":"Name","value":"entity"}}},{"kind":"Argument","name":{"kind":"Name","value":"favorite"},"value":{"kind":"Variable","name":{"kind":"Name","value":"favorite"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationResultFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationRefFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"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":"affectedEntities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationRefFields"}}]}}]}},{"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<SetEntityFavoriteMutation, SetEntityFavoriteMutationVariables>;
+export const GroupSoupMembershipDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoupMembership"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"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":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GroupSoupMembershipQuery, GroupSoupMembershipQueryVariables>;
+export const GroupSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GroupSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GroupedSoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"groupSoup"},"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":"bins"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}}]}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<GroupSoupQuery, GroupSoupQueryVariables>;
export const SetEntityPropertyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetEntityProperty"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SetEntityPropertyInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setEntityProperty"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"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"}}]}}]}}]}}]} as unknown as DocumentNode<SetEntityPropertyMutation, SetEntityPropertyMutationVariables>;
-export const SoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Soup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"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":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasMore"}}]}}]}}]}},{"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":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"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":"GraphqlSoupItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"Field","name":{"kind":"Name","value":"entity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"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":"kind"}},{"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":"id"}},{"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":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}},{"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","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":"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":"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":"GraphqlSoupChannelThread"}},"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":"metadata"}},{"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"}}]}}]}}]}}]}}]} as unknown as DocumentNode<SoupQuery, SoupQueryVariables>;
\ No newline at end of file
+export const SoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Soup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"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":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasMore"}}]}}]}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<SoupQuery, SoupQueryVariables>;
\ No newline at end of file
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/group-soup-membership.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/group-soup-membership.graphql
index 0347ccae60..6d11ac5030 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/group-soup-membership.graphql
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/group-soup-membership.graphql
@@ -7,6 +7,7 @@ query GroupSoupMembership($input: GroupedSoupInput!) {
totalCount
nextCursor
items {
+ __typename
id
}
}
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/history.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/history.graphql
index 37e4dee46b..78a8cbc26d 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/history.graphql
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/history.graphql
@@ -1,166 +1,166 @@
-fragment GraphqlHistoryItemFields on GraphqlSoupItem {
+fragment GraphqlHistoryItemFields on GraphqlSoupEntity {
+ __typename
id
entityType
frecencyScore
- entity {
- __typename
- ... on GraphqlSoupDocument {
- id
- documentName: name
- ownerId
- fileType
- projectId
- createdAt
- updatedAt
- viewedAt
- deletedAt
- subType {
- kind
+ ... on GraphqlSoupDocument {
+ id
+ documentName: name
+ ownerId
+ fileType
+ projectId
+ createdAt
+ updatedAt
+ viewedAt
+ deletedAt
+ subType {
+ __typename
+ ... on GraphqlTaskSubType {
isCompleted
}
- properties {
- ...SoupPropertyFields
- }
- notifications {
- ...SoupNotificationFields
- }
}
- ... on GraphqlSoupChat {
- id
- chatName: name
- ownerId
- projectId
- isPersistent
- createdAt
- updatedAt
- viewedAt
- deletedAt
- properties {
- ...SoupPropertyFields
- }
- notifications {
- ...SoupNotificationFields
- }
+ properties {
+ ...SoupPropertyFields
}
- ... on GraphqlSoupProject {
- id
- projectName: name
- ownerId
- parentId
- createdAt
- updatedAt
- viewedAt
- deletedAt
- properties {
- ...SoupPropertyFields
- }
- notifications {
- ...SoupNotificationFields
- }
+ notifications {
+ ...SoupNotificationFields
}
- # These fields are intentionally absent from cached Soup email records.
- # Their absence makes email projections incomplete, so record selection
- # omits email wrappers instead of returning typename-only shells.
- ... on GraphqlSoupEmailThread {
- attachmentCount
- participantCount
- }
- ... on GraphqlSoupChannel {
- id
- channelName: name
- channelType
- ownerId
- organizationId
- channelTeamId: teamId
- createdAt
- updatedAt
- viewedAt
- interactedAt
- participants {
- channelId
- userId
- role
- joinedAt
- leftAt
- }
- latestMessage {
- ...SoupChannelMessageFields
- }
- latestNonThreadMessage {
- ...SoupChannelMessageFields
- }
- notifications {
- ...SoupNotificationFields
- }
+ }
+ ... on GraphqlSoupChat {
+ id
+ chatName: name
+ ownerId
+ projectId
+ isPersistent
+ createdAt
+ updatedAt
+ viewedAt
+ deletedAt
+ properties {
+ ...SoupPropertyFields
}
- ... on GraphqlSoupChannelThread {
- id
- channelId
- senderId
- content
- createdAt
- updatedAt
- effectiveUpdatedAt
- replyCount
- notifications {
- ...SoupNotificationFields
- }
+ notifications {
+ ...SoupNotificationFields
}
- ... on GraphqlSoupCall {
- id
+ }
+ ... on GraphqlSoupProject {
+ id
+ projectName: name
+ ownerId
+ parentId
+ createdAt
+ updatedAt
+ viewedAt
+ deletedAt
+ properties {
+ ...SoupPropertyFields
+ }
+ notifications {
+ ...SoupNotificationFields
+ }
+ }
+ # These fields are intentionally absent from cached Soup email records.
+ # Their absence makes email projections incomplete, so record selection
+ # omits email wrappers instead of returning typename-only shells.
+ ... on GraphqlSoupEmailThread {
+ attachmentCount
+ participantCount
+ }
+ ... on GraphqlSoupChannel {
+ id
+ channelName: name
+ channelType
+ ownerId
+ organizationId
+ channelTeamId: teamId
+ createdAt
+ updatedAt
+ viewedAt
+ interactedAt
+ participants {
channelId
- channelName
- createdBy
- customName
- summary
- startedAt
- endedAt
- durationMs
- isActive
- status
- attended
- participants {
- userId
- joinedAt
- leftAt
- }
- properties {
- ...SoupPropertyFields
- }
- notifications {
- ...SoupNotificationFields
- }
+ userId
+ role
+ joinedAt
+ leftAt
}
- ... on GraphqlSoupCrmCompany {
- id
- crmTeamId: teamId
- crmCompanyName: name
- description
- emailSync
- hidden
- createdAt
- updatedAt
- viewedAt
- domains
- properties {
- ...SoupPropertyFields
- }
- notifications {
- ...SoupNotificationFields
- }
+ latestMessage {
+ ...SoupChannelMessageFields
}
- ... on GraphqlSoupForeignEntity {
- id
- foreignEntityId
- foreignEntitySource
- storedForId
- storedForAuthEntity
- metadata
- createdAt
- updatedAt
- notifications {
- ...SoupNotificationFields
- }
+ latestNonThreadMessage {
+ ...SoupChannelMessageFields
+ }
+ notifications {
+ ...SoupNotificationFields
+ }
+ }
+ ... on GraphqlSoupChannelMessage {
+ id
+ channelId
+ senderId
+ content
+ createdAt
+ updatedAt
+ effectiveUpdatedAt
+ replyCount
+ notifications {
+ ...SoupNotificationFields
+ }
+ }
+ ... on GraphqlSoupCall {
+ id
+ channelId
+ channelName
+ createdBy
+ customName
+ summary
+ startedAt
+ endedAt
+ durationMs
+ isActive
+ status
+ attended
+ participants {
+ userId
+ joinedAt
+ leftAt
+ }
+ properties {
+ ...SoupPropertyFields
+ }
+ notifications {
+ ...SoupNotificationFields
+ }
+ }
+ ... on GraphqlSoupCrmCompany {
+ id
+ crmTeamId: teamId
+ crmCompanyName: name
+ description
+ emailSync
+ hidden
+ createdAt
+ updatedAt
+ viewedAt
+ domains
+ properties {
+ ...SoupPropertyFields
+ }
+ notifications {
+ ...SoupNotificationFields
+ }
+ }
+ ... on GraphqlSoupForeignEntity {
+ id
+ foreignEntityId
+ foreignEntitySource
+ storedForId
+ storedForAuthEntity
+ sourceMetadata
+ createdAt
+ updatedAt
+ notifications {
+ ...SoupNotificationFields
}
}
}
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/soup.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/soup.graphql
index c1a2255832..34c4f5f17a 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/soup.graphql
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/soup.graphql
@@ -11,14 +11,11 @@ query Soup($input: SoupInput!) {
}
}
-fragment SoupItemFields on GraphqlSoupItem {
- id
- entityType
- frecencyScore
- entity {
- __typename
+fragment SoupItemFields on GraphqlSoupEntity {
+ __typename
+ ...SoupEntityCoreFields
+ frecencyScore
... on GraphqlSoupDocument {
- id
documentName: name
ownerId
fileType
@@ -28,18 +25,16 @@ fragment SoupItemFields on GraphqlSoupItem {
viewedAt
deletedAt
subType {
- kind
- isCompleted
+ __typename
+ ... on GraphqlTaskSubType {
+ isCompleted
+ }
}
properties {
...SoupPropertyFields
}
- notifications {
- ...SoupNotificationFields
- }
}
... on GraphqlSoupChat {
- id
chatName: name
ownerId
projectId
@@ -51,12 +46,8 @@ fragment SoupItemFields on GraphqlSoupItem {
properties {
...SoupPropertyFields
}
- notifications {
- ...SoupNotificationFields
- }
}
... on GraphqlSoupProject {
- id
projectName: name
ownerId
parentId
@@ -67,12 +58,8 @@ fragment SoupItemFields on GraphqlSoupItem {
properties {
...SoupPropertyFields
}
- notifications {
- ...SoupNotificationFields
- }
}
... on GraphqlSoupEmailThread {
- id
providerId
ownerId
inboxVisible
@@ -120,9 +107,6 @@ fragment SoupItemFields on GraphqlSoupItem {
properties {
...SoupPropertyFields
}
- notifications {
- ...SoupNotificationFields
- }
latestContentMessage {
__typename
id
@@ -170,7 +154,6 @@ fragment SoupItemFields on GraphqlSoupItem {
}
}
... on GraphqlSoupChannel {
- id
channelName: name
channelType
ownerId
@@ -194,12 +177,8 @@ fragment SoupItemFields on GraphqlSoupItem {
latestNonThreadMessage {
...SoupChannelMessageFields
}
- notifications {
- ...SoupNotificationFields
- }
}
- ... on GraphqlSoupChannelThread {
- id
+ ... on GraphqlSoupChannelMessage {
channelId
senderId
content
@@ -207,12 +186,8 @@ fragment SoupItemFields on GraphqlSoupItem {
updatedAt
effectiveUpdatedAt
replyCount
- notifications {
- ...SoupNotificationFields
- }
}
... on GraphqlSoupCall {
- id
channelId
channelName
createdBy
@@ -232,12 +207,8 @@ fragment SoupItemFields on GraphqlSoupItem {
properties {
...SoupPropertyFields
}
- notifications {
- ...SoupNotificationFields
- }
}
... on GraphqlSoupCrmCompany {
- id
crmTeamId: teamId
crmCompanyName: name
description
@@ -250,24 +221,26 @@ fragment SoupItemFields on GraphqlSoupItem {
properties {
...SoupPropertyFields
}
- notifications {
- ...SoupNotificationFields
- }
}
... on GraphqlSoupForeignEntity {
- id
foreignEntityId
foreignEntitySource
storedForId
storedForAuthEntity
- metadata
+ sourceMetadata
createdAt
updatedAt
- notifications {
- ...SoupNotificationFields
- }
}
- }
+}
+
+fragment SoupEntityCoreFields on GraphqlSoupEntity {
+ id
+ entityType
+ displayName
+ isFavorited
+ notifications {
+ ...SoupNotificationFields
+ }
}
fragment SoupPropertyFields on GraphqlProperty {
@@ -309,8 +282,9 @@ fragment SoupPropertyFields on GraphqlProperty {
}
}
-fragment SoupChannelMessageFields on GraphqlSoupChannelMessage {
- id
+fragment SoupChannelMessageFields on GraphqlSoupChannelMessagePreview {
+ messageId
+ channelId
threadId
senderId
content
diff --git a/apps/web/tauri/graphql_cache_plugin/src/commands.rs b/apps/web/tauri/graphql_cache_plugin/src/commands.rs
index a307a4bf63..ab678fabc2 100644
--- a/apps/web/tauri/graphql_cache_plugin/src/commands.rs
+++ b/apps/web/tauri/graphql_cache_plugin/src/commands.rs
@@ -295,6 +295,19 @@ pub async fn graphql_cache_invalidate<R: Runtime>(
Ok(affected)
}
+/// Deletes stale durable records after a server mutation returns only entity
+/// references and broadcasts the affected registered operations.
+#[tauri::command]
+pub async fn graphql_cache_delete_records<R: Runtime>(
+ app: AppHandle<R>,
+ state: State<'_, CacheState>,
+ keys: Vec<String>,
+) -> Result<Vec<String>, String> {
+ let affected = engine_handle(&state)?.delete_records(keys.clone()).await?;
+ emit_ops_affected(&app, &affected, &keys);
+ Ok(affected)
+}
+
/// Unregisters an operation (urql teardown).
#[tauri::command]
pub async fn graphql_cache_teardown(
diff --git a/apps/web/tauri/graphql_cache_plugin/src/engine.rs b/apps/web/tauri/graphql_cache_plugin/src/engine.rs
index fd48390d29..1e3edf7dde 100644
--- a/apps/web/tauri/graphql_cache_plugin/src/engine.rs
+++ b/apps/web/tauri/graphql_cache_plugin/src/engine.rs
@@ -415,6 +415,16 @@ impl EngineHandle {
Ok(ops.names(affected))
}
+ /// Deletes stale records from durable and hot storage and returns the
+ /// registered operations that traversed them.
+ pub async fn delete_records(&self, keys: Vec<String>) -> Result<Vec<String>, String> {
+ let keys: Vec<EntityKey> = keys.into_iter().map(EntityKey).collect();
+ let mut state = self.inner.lock().await;
+ let EngineState { engine, ops } = &mut *state;
+ let affected = engine.delete_keys(&keys).await.map_err(|e| e.to_string())?;
+ Ok(ops.names(affected))
+ }
+
/// Unregisters an operation (urql teardown).
pub async fn teardown(&self, op_id: String) -> Result<(), String> {
let mut state = self.inner.lock().await;
diff --git a/apps/web/tauri/graphql_cache_plugin/src/engine/test.rs b/apps/web/tauri/graphql_cache_plugin/src/engine/test.rs
index 702498faec..6a5c253941 100644
--- a/apps/web/tauri/graphql_cache_plugin/src/engine/test.rs
+++ b/apps/web/tauri/graphql_cache_plugin/src/engine/test.rs
@@ -2,7 +2,7 @@ use super::*;
use pollster::block_on;
const QUERY: &str = r#"query Soup($input: SoupInput!) {
- user { id soup(input: $input) { nextCursor hasMore items { id } } }
+ user { id soup(input: $input) { nextCursor hasMore items { __typename id } } }
}"#;
fn variables() -> Variables {
@@ -19,7 +19,7 @@ fn soup_data(has_more: bool) -> serde_json::Value {
"soup": {
"nextCursor": null,
"hasMore": has_more,
- "items": [{"id": "doc-1"}]
+ "items": [{"__typename": "GraphqlSoupDocument", "id": "doc-1"}]
}
}
})
@@ -86,13 +86,11 @@ fn record_selection_returns_native_cache_entities() {
id
soup(input: $input) {
items {
+ __typename
id
- entity {
- __typename
- ... on GraphqlSoupDocument {
- id name fileType createdAt updatedAt viewedAt deletedAt
- subType { kind isCompleted }
- }
+ ... on GraphqlSoupDocument {
+ id name fileType createdAt updatedAt viewedAt deletedAt
+ subType { kind isCompleted }
}
}
nextCursor
@@ -105,18 +103,15 @@ fn record_selection_returns_native_cache_entities() {
"id": "user-1",
"soup": {
"items": [{
- "id": "item-1",
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": "doc-1",
- "name": "A note",
- "fileType": "md",
- "createdAt": "1970-01-01T00:00:01Z",
- "updatedAt": "1970-01-01T00:00:02Z",
- "viewedAt": "1970-01-01T00:00:03Z",
- "deletedAt": null,
- "subType": null
- }
+ "__typename": "GraphqlSoupDocument",
+ "id": "doc-1",
+ "name": "A note",
+ "fileType": "md",
+ "createdAt": "1970-01-01T00:00:01Z",
+ "updatedAt": "1970-01-01T00:00:02Z",
+ "viewedAt": "1970-01-01T00:00:03Z",
+ "deletedAt": null,
+ "subType": null
}],
"nextCursor": null,
"hasMore": false
@@ -168,7 +163,7 @@ fn query_inspection_serializes_generated_variables_and_value() {
"value": {
"nextCursor": null,
"hasMore": false,
- "items": [{"id": "doc-1"}]
+ "items": [{"__typename": "GraphqlSoupDocument", "id": "doc-1"}]
}
}])
);
diff --git a/apps/web/tauri/src-tauri/src/lib.rs b/apps/web/tauri/src-tauri/src/lib.rs
index 141734047e..9bb622cd69 100644
--- a/apps/web/tauri/src-tauri/src/lib.rs
+++ b/apps/web/tauri/src-tauri/src/lib.rs
@@ -253,6 +253,7 @@ pub fn run() {
graphql_cache_plugin::commands::graphql_cache_commit_optimistic_write,
graphql_cache_plugin::commands::graphql_cache_rollback_optimistic_write,
graphql_cache_plugin::commands::graphql_cache_invalidate,
+ graphql_cache_plugin::commands::graphql_cache_delete_records,
graphql_cache_plugin::commands::graphql_cache_teardown,
graphql_cache_plugin::commands::graphql_cache_clear,
macro_bundle_updater_plugin::inbound::plugin::grant_bundle_update,
diff --git a/crates/client/cache-core/src/document.rs b/crates/client/cache-core/src/document.rs
index 04ba4fbe72..23e3949d2b 100644
--- a/crates/client/cache-core/src/document.rs
+++ b/crates/client/cache-core/src/document.rs
@@ -422,17 +422,15 @@ mod tests {
query Soup($input: SoupInput!) {
soup(input: $input) {
items {
+ __typename
id
- entity {
- __typename
- ... on GraphqlSoupDocument { id docName: name }
- ...ChatFields
- }
+ ... on GraphqlSoupDocument { docName: name }
+ ...ChatFields
}
nextCursor
}
}
- fragment ChatFields on GraphqlSoupChat { id chatName: name }
+ fragment ChatFields on GraphqlSoupChat { chatName: name }
"#;
#[test]
@@ -450,10 +448,7 @@ mod tests {
let Selection::Field(items) = &soup.selection_set[0] else {
panic!()
};
- let Selection::Field(entity) = &items.selection_set[1] else {
- panic!()
- };
- let conditions: Vec<_> = entity
+ let conditions: Vec<_> = items
.selection_set
.iter()
.filter_map(|s| match s {
diff --git a/crates/client/cache-core/src/engine.rs b/crates/client/cache-core/src/engine.rs
index 42a756692a..f919bb16eb 100644
--- a/crates/client/cache-core/src/engine.rs
+++ b/crates/client/cache-core/src/engine.rs
@@ -304,6 +304,16 @@ impl<S: Storage> Engine<S> {
Ok(self.identity.clone())
}
+ /// Returns the opaque identity currently bound to this cache, hydrating
+ /// it from persistent storage when necessary.
+ pub async fn current_identity(&mut self) -> Result<Option<String>, EngineError<S::Error>> {
+ match self.bound_identity().await? {
+ IdentityState::NotHydrated => unreachable!("bound_identity hydrates"),
+ IdentityState::Missing => Ok(None),
+ IdentityState::Bound(identity) => Ok(Some(identity)),
+ }
+ }
+
async fn bind_identity(&mut self, user_id: &str) -> Result<(), EngineError<S::Error>> {
let mut record = Record::default();
record.fields.insert(
@@ -1162,6 +1172,28 @@ impl<S: Storage> Engine<S> {
affected
}
+ /// Deletes locally stale records from both durable and hot tiers and
+ /// returns active operations that traversed those records.
+ ///
+ /// Use this after a server-side mutation that returns entity references
+ /// but not replacement entity records. Cross-engine notifications for
+ /// records already written to shared storage should use
+ /// [`Self::invalidate_keys`] instead.
+ pub async fn delete_keys(
+ &mut self,
+ keys: &[EntityKey],
+ ) -> Result<BTreeSet<OpId>, EngineError<S::Error>> {
+ let affected = self.deps.ops_for_keys(keys.iter());
+ self.storage
+ .delete_batch(keys)
+ .await
+ .map_err(EngineError::Storage)?;
+ for key in keys {
+ self.hot.pop(key);
+ }
+ Ok(affected)
+ }
+
/// Drops all cached state (logout, schema-hash mismatch), including any
/// pending optimistic layers.
pub async fn clear(&mut self) -> Result<(), EngineError<S::Error>> {
diff --git a/crates/client/cache-core/src/meta.rs b/crates/client/cache-core/src/meta.rs
index 7d3885ef7f..118c62f97f 100644
--- a/crates/client/cache-core/src/meta.rs
+++ b/crates/client/cache-core/src/meta.rs
@@ -111,9 +111,9 @@ mod tests {
}
#[test]
- fn union_possible_types() {
- let entity = type_meta("GraphqlSoupEntity").expect("entity union");
- assert_eq!(entity.kind, TypeKind::Union);
+ fn interface_possible_types() {
+ let entity = type_meta("GraphqlSoupEntity").expect("entity interface");
+ assert_eq!(entity.kind, TypeKind::Interface);
assert!(entity.possible_types.contains(&"GraphqlSoupDocument"));
assert!(entity.possible_types.contains(&"GraphqlSoupForeignEntity"));
assert_eq!(entity.possible_types.len(), 9);
@@ -162,15 +162,17 @@ mod tests {
assert_eq!(f.ty.kind, FieldKind::Leaf);
assert!(f.ty.nullable && !f.ty.list);
- // metadata: JSON! (opaque scalar)
- let f = field_meta("GraphqlSoupForeignEntity", "metadata").unwrap();
+ // sourceMetadata: JSON! (opaque scalar); metadata is now the shared
+ // structured interface field.
+ let f = field_meta("GraphqlSoupForeignEntity", "sourceMetadata").unwrap();
assert_eq!(f.ty.kind, FieldKind::OpaqueScalar);
assert!(!f.ty.nullable);
- // entity: GraphqlSoupEntity! (composite link to a union)
- let f = field_meta("GraphqlSoupItem", "entity").unwrap();
+ // items: [GraphqlSoupEntity!]! (composite link to the entity interface)
+ let f = field_meta("SoupPage", "items").unwrap();
assert_eq!(f.ty.kind, FieldKind::Composite);
assert_eq!(f.ty.name, "GraphqlSoupEntity");
+ assert!(f.ty.list);
}
#[test]
diff --git a/crates/client/cache-core/src/query_inspection/test.rs b/crates/client/cache-core/src/query_inspection/test.rs
index 0110b7a102..ba15abe83b 100644
--- a/crates/client/cache-core/src/query_inspection/test.rs
+++ b/crates/client/cache-core/src/query_inspection/test.rs
@@ -6,7 +6,7 @@ fn concrete_union_member_outside_selected_fragment_is_absent() {
"__typename".to_string(),
CacheValue::String("GraphqlSoupChannel".to_string()),
)]);
- // These are selections beneath the GraphqlSoupEntity union. The cached
+ // These are selections beneath the GraphqlSoupEntity interface. The cached
// channel does not match the document-only fragment containing properties.
let selections = vec![Selection::Fragment {
type_condition: Some("GraphqlSoupDocument".to_string()),
diff --git a/crates/client/cache-core/src/record_selection/test.rs b/crates/client/cache-core/src/record_selection/test.rs
index 5620549045..54f93c2821 100644
--- a/crates/client/cache-core/src/record_selection/test.rs
+++ b/crates/client/cache-core/src/record_selection/test.rs
@@ -4,21 +4,17 @@ use super::*;
fn accepts_fragment_only_object_document() {
let selection = RecordSelection::parse(
r#"
- fragment SoupItemFields on GraphqlSoupItem {
- itemId: id
+ fragment SoupItemFields on GraphqlSoupDocument {
+ documentId: id
entityType
- entity {
- __typename
- ... on GraphqlSoupDocument { id name }
- ... on GraphqlSoupChat { id name }
- }
+ displayName
}
"#,
"SoupItemFields",
)
.unwrap();
- assert_eq!(selection.type_names(), &["GraphqlSoupItem"]);
+ assert_eq!(selection.type_names(), &["GraphqlSoupDocument"]);
}
#[test]
@@ -72,7 +68,7 @@ fn rejects_embedded_root_and_unbound_variables() {
#[test]
fn rejects_unknown_fragment_and_type() {
assert!(matches!(
- RecordSelection::parse("fragment Item on GraphqlSoupItem { id }", "Missing"),
+ RecordSelection::parse("fragment Item on GraphqlSoupDocument { id }", "Missing"),
Err(RecordSelectionError::Document(
DocumentError::UnknownFragment(_)
))
@@ -83,7 +79,7 @@ fn rejects_unknown_fragment_and_type() {
));
assert!(matches!(
RecordSelection::parse(
- "fragment Item on GraphqlSoupItem { id } fragment Unused on MissingType { id }",
+ "fragment Item on GraphqlSoupDocument { id } fragment Unused on MissingType { id }",
"Item",
),
Err(RecordSelectionError::UnknownType(_))
@@ -105,7 +101,7 @@ fn validates_page_limits() {
#[test]
fn cursor_has_opaque_roundtrip() {
- let cursor = RecordCursor::new(EntityKey("GraphqlSoupItem:item-1".to_string()));
+ let cursor = RecordCursor::new(EntityKey("GraphqlSoupDocument:item-1".to_string()));
let encoded = serde_json::to_value(&cursor).unwrap();
assert_eq!(
serde_json::from_value::<RecordCursor>(encoded).unwrap(),
diff --git a/crates/client/cache-core/tests/engine.rs b/crates/client/cache-core/tests/engine.rs
index 7b38702157..93cd4b74d5 100644
--- a/crates/client/cache-core/tests/engine.rs
+++ b/crates/client/cache-core/tests/engine.rs
@@ -12,11 +12,9 @@ query Soup($input: SoupInput!) {
id
soup(input: $input) {
items {
+ __typename
id
- entity {
- __typename
- ... on GraphqlSoupDocument { id documentName: name ownerId }
- }
+ ... on GraphqlSoupDocument { documentName: name ownerId }
}
nextCursor
hasMore
@@ -42,13 +40,10 @@ fn page_for_user(user: &str, names: &[(&str, &str)]) -> Json {
"id": user,
"soup": {
"items": names.iter().map(|(id, name)| json!({
+ "__typename": "GraphqlSoupDocument",
"id": id,
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": id,
- "documentName": name,
- "ownerId": user
- }
+ "documentName": name,
+ "ownerId": user
})).collect::<Vec<_>>(),
"nextCursor": null,
"hasMore": false
@@ -133,10 +128,7 @@ fn cross_operation_invalidation() {
else {
panic!("expected hit");
};
- assert_eq!(
- data["user"]["soup"]["items"][0]["entity"]["documentName"],
- json!("B")
- );
+ assert_eq!(data["user"]["soup"]["items"][0]["documentName"], json!("B"));
// Identical rewrite changes nothing → nobody re-executes.
let write = engine
@@ -329,11 +321,9 @@ fn capacity_constrained_rewrite_preserves_fields() {
id
soup(input: $input) {
items {
+ __typename
id
- entity {
- __typename
- ... on GraphqlSoupDocument { id documentName: name }
- }
+ ... on GraphqlSoupDocument { documentName: name }
}
nextCursor
hasMore
@@ -346,9 +336,9 @@ fn capacity_constrained_rewrite_preserves_fields() {
"id": "user-1",
"soup": {
"items": [
- { "id": "doc-1", "entity": { "__typename": "GraphqlSoupDocument", "id": "doc-1", "documentName": "A2" } },
- { "id": "doc-2", "entity": { "__typename": "GraphqlSoupDocument", "id": "doc-2", "documentName": "B2" } },
- { "id": "doc-3", "entity": { "__typename": "GraphqlSoupDocument", "id": "doc-3", "documentName": "C2" } }
+ { "__typename": "GraphqlSoupDocument", "id": "doc-1", "documentName": "A2" },
+ { "__typename": "GraphqlSoupDocument", "id": "doc-2", "documentName": "B2" },
+ { "__typename": "GraphqlSoupDocument", "id": "doc-3", "documentName": "C2" }
],
"nextCursor": null,
"hasMore": false
@@ -372,8 +362,8 @@ fn capacity_constrained_rewrite_preserves_fields() {
let items = data["user"]["soup"]["items"].as_array().unwrap();
assert_eq!(items.len(), 3);
for (item, name) in items.iter().zip(["A2", "B2", "C2"]) {
- assert_eq!(item["entity"]["documentName"], json!(name));
- assert_eq!(item["entity"]["ownerId"], json!("user-1"));
+ assert_eq!(item["documentName"], json!(name));
+ assert_eq!(item["ownerId"], json!("user-1"));
}
});
}
diff --git a/crates/client/cache-core/tests/grouped_optimistic.rs b/crates/client/cache-core/tests/grouped_optimistic.rs
index 0a79034a3c..cea0bf4ee5 100644
--- a/crates/client/cache-core/tests/grouped_optimistic.rs
+++ b/crates/client/cache-core/tests/grouped_optimistic.rs
@@ -20,18 +20,15 @@ query GroupSoup($input: GroupedSoupInput!) {
totalCount
nextCursor
items {
- id
- entity {
- __typename
- ... on GraphqlSoupDocument {
+ __typename
+ ... on GraphqlSoupDocument {
+ id
+ properties {
id
- properties {
- id
- propertyDefinitionId
- value {
- __typename
- ... on GraphqlSelectOptionPropertyValue { optionIds }
- }
+ propertyDefinitionId
+ value {
+ __typename
+ ... on GraphqlSelectOptionPropertyValue { optionIds }
}
}
}
@@ -104,12 +101,9 @@ fn group_page() -> Json {
"totalCount": 1,
"nextCursor": "source-cursor",
"items": [{
+ "__typename": "GraphqlSoupDocument",
"id": "task-1",
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": "task-1",
- "properties": [property("in-progress")]
- }
+ "properties": [property("in-progress")]
}]
},
{
@@ -209,13 +203,13 @@ fn cache_only_read_observes_move_and_rollback_restores_it() {
patch(
"in-progress",
LinkOperation::Remove {
- entity_key: EntityKey("GraphqlSoupItem:task-1".into()),
+ entity_key: EntityKey("GraphqlSoupDocument:task-1".into()),
},
),
patch(
"completed",
LinkOperation::PrependUnique {
- entity_key: EntityKey("GraphqlSoupItem:task-1".into()),
+ entity_key: EntityKey("GraphqlSoupDocument:task-1".into()),
},
),
];
@@ -286,13 +280,13 @@ fn success_reapplies_recipe_and_returns_deduplicated_revalidation() {
patch(
"in-progress",
LinkOperation::Remove {
- entity_key: EntityKey("GraphqlSoupItem:task-1".into()),
+ entity_key: EntityKey("GraphqlSoupDocument:task-1".into()),
},
),
patch(
"completed",
LinkOperation::PrependUnique {
- entity_key: EntityKey("GraphqlSoupItem:task-1".into()),
+ entity_key: EntityKey("GraphqlSoupDocument:task-1".into()),
},
),
];
@@ -317,12 +311,9 @@ fn success_reapplies_recipe_and_returns_deduplicated_revalidation() {
// earlier optimistic field snapshot over it.
let mut concurrent = group_page();
concurrent["user"]["groupSoup"]["bins"][1]["items"] = json!([{
+ "__typename": "GraphqlSoupDocument",
"id": "task-2",
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": "task-2",
- "properties": []
- }
+ "properties": []
}]);
engine
.write_query(
@@ -369,13 +360,13 @@ fn missing_destination_rejects_the_whole_patch_set_without_enqueueing() {
patch(
"in-progress",
LinkOperation::Remove {
- entity_key: EntityKey("GraphqlSoupItem:task-1".into()),
+ entity_key: EntityKey("GraphqlSoupDocument:task-1".into()),
},
),
patch(
"missing",
LinkOperation::PrependUnique {
- entity_key: EntityKey("GraphqlSoupItem:task-1".into()),
+ entity_key: EntityKey("GraphqlSoupDocument:task-1".into()),
},
),
];
diff --git a/crates/client/cache-core/tests/optimistic.rs b/crates/client/cache-core/tests/optimistic.rs
index 23bc405301..980ec11d1d 100644
--- a/crates/client/cache-core/tests/optimistic.rs
+++ b/crates/client/cache-core/tests/optimistic.rs
@@ -14,18 +14,15 @@ query Soup($input: SoupInput!) {
id
soup(input: $input) {
items {
+ __typename
id
- entity {
- __typename
- ... on GraphqlSoupDocument {
+ ... on GraphqlSoupDocument {
+ properties {
id
- properties {
- id
- displayName
- value {
- __typename
- ... on GraphqlStringPropertyValue { stringValue: value }
- }
+ displayName
+ value {
+ __typename
+ ... on GraphqlStringPropertyValue { stringValue: value }
}
}
}
@@ -78,19 +75,16 @@ fn soup_page(display_name: &str, value: &str) -> Json {
"id": "user-1",
"soup": {
"items": [{
- "id": "item-1",
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": "doc-1",
- "properties": [{
- "id": "prop-1",
- "displayName": display_name,
- "value": {
- "__typename": "GraphqlStringPropertyValue",
- "stringValue": value
- }
- }]
- }
+ "__typename": "GraphqlSoupDocument",
+ "id": "doc-1",
+ "properties": [{
+ "id": "prop-1",
+ "displayName": display_name,
+ "value": {
+ "__typename": "GraphqlStringPropertyValue",
+ "stringValue": value
+ }
+ }]
}],
"hasMore": false
}
@@ -112,7 +106,7 @@ fn mutation_response(display_name: &str, value: &str) -> Json {
}
fn property_of(data: &Json) -> &Json {
- &data["user"]["soup"]["items"][0]["entity"]["properties"][0]
+ &data["user"]["soup"]["items"][0]["properties"][0]
}
async fn engine_with_base(display_name: &str, value: &str) -> Engine<InMemoryStorage> {
diff --git a/crates/client/cache-core/tests/query_inspection.rs b/crates/client/cache-core/tests/query_inspection.rs
index 60ab857f79..a4b9b2dbdc 100644
--- a/crates/client/cache-core/tests/query_inspection.rs
+++ b/crates/client/cache-core/tests/query_inspection.rs
@@ -15,7 +15,7 @@ query GroupViews($input: GroupedSoupInput!) {
user {
id
groupSoup(input: $input) {
- bins { key nextCursor items { id } }
+ bins { key nextCursor items { __typename id } }
}
}
}
@@ -23,7 +23,7 @@ query GroupViews($input: GroupedSoupInput!) {
const SHORT_GROUP_QUERY: &str = r#"
query GroupViews($input: GroupedSoupInput!) {
- user { id groupSoup(input: $input) { bins { key items { id } } } }
+ user { id groupSoup(input: $input) { bins { key items { __typename id } } } }
}
"#;
@@ -53,7 +53,7 @@ fn page(item: &str, next_cursor: Option<&str>) -> Json {
json!({"user": {"id": "user-1", "groupSoup": {"bins": [{
"key": "in-progress",
"nextCursor": next_cursor,
- "items": [{"id": item}]
+ "items": [{"__typename": "GraphqlSoupDocument", "id": item}]
}]}}})
}
@@ -163,7 +163,7 @@ query GroupViews($same: String!, $cursor: String!) {
groupKey: "in-progress"
cursor: $cursor
}
- }) { bins { key nextCursor items { id } } }
+ }) { bins { key nextCursor items { __typename id } } }
}
}
"#;
@@ -234,7 +234,7 @@ fn inspection_reads_the_effective_optimistic_view() {
let mut engine = Engine::new(InMemoryStorage::new());
let variables = initial(20);
let data = json!({"user": {"id": "user-1", "groupSoup": {"bins": [
- {"key": "in-progress", "nextCursor": null, "items": [{"id": "task-1"}]},
+ {"key": "in-progress", "nextCursor": null, "items": [{"__typename": "GraphqlSoupDocument", "id": "task-1"}]},
{"key": "completed", "nextCursor": null, "items": []}
]}}});
write_group(&mut engine, GROUP_QUERY, &variables, &data).await;
@@ -264,7 +264,7 @@ fn inspection_reads_the_effective_optimistic_view() {
},
],
operation: LinkOperation::Remove {
- entity_key: EntityKey("GraphqlSoupItem:task-1".into()),
+ entity_key: EntityKey("GraphqlSoupDocument:task-1".into()),
},
};
let mutation = r#"
@@ -359,7 +359,7 @@ query GroupViews {
groupSoup(input: { initial: {
groupBy: { field: PROPERTY, propertyDefinitionId: "status-def" }
limit: 20
- } }) { bins { items { id } } }
+ } }) { bins { items { __typename id } } }
}
}
"#;
diff --git a/crates/client/cache-core/tests/record_selection.rs b/crates/client/cache-core/tests/record_selection.rs
index 9508b061d6..c62d7c0681 100644
--- a/crates/client/cache-core/tests/record_selection.rs
+++ b/crates/client/cache-core/tests/record_selection.rs
@@ -23,14 +23,30 @@ fn key(value: &str) -> EntityKey {
EntityKey(value.to_string())
}
-fn item(id: &str, entity: Option<EntityKey>) -> (EntityKey, Record) {
+fn linked_document(id: &str, property: Option<EntityKey>) -> (EntityKey, Record) {
let mut fields = vec![("id", CacheValue::String(id.to_string()))];
- if let Some(entity) = entity {
- fields.push(("entity", CacheValue::Ref(entity)));
+ if let Some(property) = property {
+ fields.push((
+ "properties",
+ CacheValue::List(vec![CacheValue::Ref(property)]),
+ ));
}
(
- key(&format!("GraphqlSoupItem:{id}")),
- record("GraphqlSoupItem", fields),
+ key(&format!("GraphqlSoupDocument:{id}")),
+ record("GraphqlSoupDocument", fields),
+ )
+}
+
+fn property(id: &str, name: &str) -> (EntityKey, Record) {
+ (
+ key(&format!("GraphqlProperty:{id}")),
+ record(
+ "GraphqlProperty",
+ [
+ ("id", CacheValue::String(id.to_string())),
+ ("displayName", CacheValue::String(name.to_string())),
+ ],
+ ),
)
}
@@ -48,14 +64,11 @@ fn document(id: &str, name: &str) -> (EntityKey, Record) {
}
const ITEM_FRAGMENT: &str = r#"
-fragment SoupItemFields on GraphqlSoupItem {
- itemId: id
- entity {
- __typename
- ... on GraphqlSoupDocument {
- id
- documentName: name
- }
+fragment SoupItemFields on GraphqlSoupDocument {
+ documentId: id
+ properties {
+ id
+ propertyName: displayName
}
}
"#;
@@ -66,11 +79,11 @@ fn projects_cold_links_skips_incomplete_and_paginates_exclusively() {
let mut storage = InMemoryStorage::new();
storage
.put_batch(vec![
- item("a", Some(key("GraphqlSoupDocument:a"))),
- item("b", None),
- item("c", Some(key("GraphqlSoupDocument:c"))),
- document("a", "Alpha"),
- document("c", "Charlie"),
+ linked_document("a", Some(key("GraphqlProperty:a"))),
+ linked_document("b", None),
+ linked_document("c", Some(key("GraphqlProperty:c"))),
+ property("a", "Alpha"),
+ property("c", "Charlie"),
])
.await
.unwrap();
@@ -81,12 +94,11 @@ fn projects_cold_links_skips_incomplete_and_paginates_exclusively() {
assert_eq!(
first.records,
vec![json!({
- "itemId": "a",
- "entity": {
- "__typename": "GraphqlSoupDocument",
+ "documentId": "a",
+ "properties": [{
"id": "a",
- "documentName": "Alpha"
- }
+ "propertyName": "Alpha"
+ }]
})]
);
assert!(first.next_cursor.is_some());
@@ -95,9 +107,9 @@ fn projects_cold_links_skips_incomplete_and_paginates_exclusively() {
.read_records(&selection, first.next_cursor.as_ref(), 1)
.await
.unwrap();
- assert_eq!(second.records[0]["itemId"], json!("c"));
+ assert_eq!(second.records[0]["documentId"], json!("c"));
assert_eq!(
- second.records[0]["entity"]["documentName"],
+ second.records[0]["properties"][0]["propertyName"],
json!("Charlie")
);
assert!(second.next_cursor.is_none());
@@ -156,7 +168,6 @@ fn merges_optimistic_updates_with_cold_linked_bases() {
let mut storage = InMemoryStorage::new();
storage
.put_batch(vec![
- item("item-1", Some(document_key.clone())),
(
document_key,
record(
@@ -189,13 +200,9 @@ fn merges_optimistic_updates_with_cold_linked_bases() {
.unwrap();
let mut engine = Engine::with_capacity(storage, 1);
let selection = RecordSelection::parse(
- r#"fragment Item on GraphqlSoupItem {
+ r#"fragment Item on GraphqlSoupDocument {
id
- entity {
- ... on GraphqlSoupDocument {
- properties { id propertyDefinitionId displayName }
- }
- }
+ properties { id propertyDefinitionId displayName }
}"#,
"Item",
)
@@ -236,7 +243,7 @@ fn merges_optimistic_updates_with_cold_linked_bases() {
let page = engine.read_records(&selection, None, 10).await.unwrap();
assert_eq!(page.records.len(), 1);
assert_eq!(
- page.records[0]["entity"]["properties"][0],
+ page.records[0]["properties"][0],
json!({
"id": "property-1",
"propertyDefinitionId": "definition-1",
diff --git a/crates/client/cache-core/tests/roundtrip.rs b/crates/client/cache-core/tests/roundtrip.rs
index eed63bc1b4..5a72a5b8a5 100644
--- a/crates/client/cache-core/tests/roundtrip.rs
+++ b/crates/client/cache-core/tests/roundtrip.rs
@@ -15,32 +15,28 @@ query Soup($input: SoupInput!) {
id
soup(input: $input) {
items {
+ __typename
id
entityType
frecencyScore
- entity {
- __typename
- ... on GraphqlSoupDocument {
- id
- documentName: name
- ownerId
- updatedAt
- properties {
- ...SoupPropertyFields
- }
+ ... on GraphqlSoupDocument {
+ documentName: name
+ ownerId
+ updatedAt
+ properties {
+ ...SoupPropertyFields
}
- ... on GraphqlSoupChannel {
- id
- channelName: name
- channelType
- latestMessage {
- ...SoupChannelMessageFields
- }
- participants {
- channelId
- userId
- role
- }
+ }
+ ... on GraphqlSoupChannel {
+ channelName: name
+ channelType
+ latestMessage {
+ ...SoupChannelMessageFields
+ }
+ participants {
+ channelId
+ userId
+ role
}
}
}
@@ -66,8 +62,8 @@ fragment SoupPropertyFields on GraphqlProperty {
}
}
-fragment SoupChannelMessageFields on GraphqlSoupChannelMessage {
- id
+fragment SoupChannelMessageFields on GraphqlSoupChannelMessagePreview {
+ messageId
threadId
senderId
content
@@ -91,12 +87,10 @@ fn response_data() -> Json {
"soup": {
"items": [
{
+ "__typename": "GraphqlSoupDocument",
"id": "doc-1",
"entityType": "DOCUMENT",
"frecencyScore": 0.5,
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": "doc-1",
"documentName": "Design doc",
"ownerId": "user-1",
"updatedAt": "2026-07-01T00:00:00Z",
@@ -115,19 +109,16 @@ fn response_data() -> Json {
}
}
]
- }
},
{
+ "__typename": "GraphqlSoupChannel",
"id": "ch-1",
"entityType": "CHANNEL",
"frecencyScore": 0.25,
- "entity": {
- "__typename": "GraphqlSoupChannel",
- "id": "ch-1",
"channelName": "general",
"channelType": "PUBLIC",
"latestMessage": {
- "id": "msg-1",
+ "messageId": "msg-1",
"threadId": null,
"senderId": "user-2",
"content": "hello",
@@ -136,7 +127,6 @@ fn response_data() -> Json {
"participants": [
{ "channelId": "ch-1", "userId": "user-1", "role": "member" }
]
- }
}
],
"nextCursor": "cursor-2",
@@ -166,10 +156,7 @@ fn normalizes_expected_records() {
vec![
"GraphqlProperty:entity-prop-1",
"GraphqlSoupChannel:ch-1",
- "GraphqlSoupChannelMessage:msg-1",
"GraphqlSoupDocument:doc-1",
- "GraphqlSoupItem:ch-1",
- "GraphqlSoupItem:doc-1",
"GraphqlUser:user-1",
"ROOT_QUERY",
]
@@ -189,10 +176,12 @@ fn normalizes_expected_records() {
Some(CacheValue::List(items))
if matches!(&items[0], CacheValue::Ref(k) if k.0 == "GraphqlProperty:entity-prop-1")
));
+ // Message previews are embedded: they carry `messageId`, not a global
+ // `id`, so the channel record owns its own copy.
let channel = &records[&EntityKey("GraphqlSoupChannel:ch-1".into())];
assert!(matches!(
channel.fields.get("latestMessage"),
- Some(CacheValue::Ref(k)) if k.0 == "GraphqlSoupChannelMessage:msg-1"
+ Some(CacheValue::Object(_))
));
// The root links to the viewer; the args-keyed soup page lives on it.
@@ -230,10 +219,7 @@ fn round_trip_reproduces_response() {
vec![
"GraphqlProperty:entity-prop-1",
"GraphqlSoupChannel:ch-1",
- "GraphqlSoupChannelMessage:msg-1",
"GraphqlSoupDocument:doc-1",
- "GraphqlSoupItem:ch-1",
- "GraphqlSoupItem:doc-1",
"GraphqlUser:user-1",
"ROOT_QUERY",
]
@@ -252,7 +238,7 @@ fn entity_update_visible_through_other_query() {
user {
id
soup(input: $input) {
- items { id entity { __typename ... on GraphqlSoupDocument { id documentName: name } } }
+ items { __typename id ... on GraphqlSoupDocument { documentName: name } }
nextCursor
hasMore
}
@@ -265,12 +251,9 @@ fn entity_update_visible_through_other_query() {
"id": "user-1",
"soup": {
"items": [{
+ "__typename": "GraphqlSoupDocument",
"id": "doc-1",
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": "doc-1",
- "documentName": "Renamed"
- }
+ "documentName": "Renamed"
}],
"nextCursor": null,
"hasMore": false
@@ -297,7 +280,7 @@ fn entity_update_visible_through_other_query() {
panic!("expected complete read");
};
assert_eq!(
- data["user"]["soup"]["items"][0]["entity"]["documentName"],
+ data["user"]["soup"]["items"][0]["documentName"],
json!("Renamed")
);
}
diff --git a/crates/client/cache-idb/tests/web.rs b/crates/client/cache-idb/tests/web.rs
index 0f2a532eba..a437d3511e 100644
--- a/crates/client/cache-idb/tests/web.rs
+++ b/crates/client/cache-idb/tests/web.rs
@@ -175,13 +175,13 @@ async fn engine_over_idb() {
let mut engine = Engine::new(storage);
let query = r#"query Soup($input: SoupInput!) {
- user { id soup(input: $input) { nextCursor hasMore items { id } } }
+ user { id soup(input: $input) { nextCursor hasMore items { __typename id } } }
}"#;
let serde_json::Value::Object(vars) = serde_json::json!({"input": {"limit": 1}}) else {
unreachable!()
};
let data = serde_json::json!({
- "user": { "id": "user-1", "soup": { "nextCursor": null, "hasMore": false, "items": [{"id": "doc-1"}] } }
+ "user": { "id": "user-1", "soup": { "nextCursor": null, "hasMore": false, "items": [{"__typename": "GraphqlSoupDocument", "id": "doc-1"}] } }
});
engine
@@ -198,7 +198,7 @@ async fn engine_over_idb() {
assert_eq!(cached, data);
let selection =
- RecordSelection::parse("fragment Item on GraphqlSoupItem { id }", "Item").unwrap();
+ RecordSelection::parse("fragment Item on GraphqlSoupDocument { id }", "Item").unwrap();
let page = engine.read_records(&selection, None, 10).await.unwrap();
assert_eq!(page.records, vec![serde_json::json!({"id": "doc-1"})]);
assert!(page.next_cursor.is_none());
diff --git a/crates/client/cache-sqlite/src/lib.rs b/crates/client/cache-sqlite/src/lib.rs
index 83df316cab..a6cb734a5e 100644
--- a/crates/client/cache-sqlite/src/lib.rs
+++ b/crates/client/cache-sqlite/src/lib.rs
@@ -672,13 +672,13 @@ mod tests {
let storage = SqliteStorage::open_in_memory("user-1").unwrap();
let mut engine = Engine::new(storage);
let query = r#"query Soup($input: SoupInput!) {
- user { id soup(input: $input) { nextCursor hasMore items { id } } }
+ user { id soup(input: $input) { nextCursor hasMore items { __typename id } } }
}"#;
let serde_json::Value::Object(vars) = serde_json::json!({"input": {"limit": 1}}) else {
unreachable!()
};
let data = serde_json::json!({
- "user": { "id": "user-1", "soup": { "nextCursor": null, "hasMore": false, "items": [{"id": "doc-1"}] } }
+ "user": { "id": "user-1", "soup": { "nextCursor": null, "hasMore": false, "items": [{"__typename": "GraphqlSoupDocument", "id": "doc-1"}] } }
});
engine
.write_query(None, query, Some("Soup"), &vars, &data, None)
diff --git a/crates/client/cache-sqlite/tests/mutation_queue.rs b/crates/client/cache-sqlite/tests/mutation_queue.rs
index 5b98125833..90ec692f84 100644
--- a/crates/client/cache-sqlite/tests/mutation_queue.rs
+++ b/crates/client/cache-sqlite/tests/mutation_queue.rs
@@ -13,13 +13,10 @@ query Soup($input: SoupInput!) {
id
soup(input: $input) {
items {
+ __typename
id
- entity {
- __typename
- ... on GraphqlSoupDocument {
- id
- properties { id displayName }
- }
+ ... on GraphqlSoupDocument {
+ properties { id displayName }
}
}
hasMore
@@ -136,11 +133,11 @@ fn restart_hydration_preserves_legacy_json_with_envelope_keys() {
unreachable!()
};
let base = json!({"user": {"id": "user-1", "soup": {
- "items": [{"id": "item-1", "entity": {
+ "items": [{
"__typename": "GraphqlSoupDocument",
"id": "doc-1",
"properties": [{"id": "prop-1", "displayName": "Status"}]
- }}],
+ }],
"hasMore": false
}}});
let optimistic = json!({
@@ -196,7 +193,7 @@ fn restart_hydration_preserves_legacy_json_with_envelope_keys() {
panic!("expected hydrated hit");
};
assert_eq!(
- data["user"]["soup"]["items"][0]["entity"]["properties"][0]["displayName"],
+ data["user"]["soup"]["items"][0]["properties"][0]["displayName"],
json!("Stage")
);
});
diff --git a/crates/client/cache-wasm/src/shell.rs b/crates/client/cache-wasm/src/shell.rs
index 66704e75c8..f0caa43982 100644
--- a/crates/client/cache-wasm/src/shell.rs
+++ b/crates/client/cache-wasm/src/shell.rs
@@ -209,6 +209,22 @@ fn parse_vec<T: serde::de::DeserializeOwned>(value: JsValue) -> Result<Vec<T>, J
#[wasm_bindgen]
impl CacheEngine {
+ /// Returns the opaque identity bound to this cache, or `null` when no
+ /// identity-bearing response has been stored yet.
+ #[wasm_bindgen(js_name = boundIdentity)]
+ pub fn bound_identity(&self) -> js_sys::Promise {
+ let engine = self.engine.clone();
+ future_to_promise(async move {
+ let identity = engine
+ .lock()
+ .await
+ .current_identity()
+ .await
+ .map_err(err_js)?;
+ to_js(&identity)
+ })
+ }
+
/// Attempts a cache read. Resolves to `{kind:"hit",data}` or
/// `{kind:"miss"}`. When `opId` is given, the operation is registered
/// as active for dependency-driven re-execution.
@@ -530,6 +546,24 @@ impl CacheEngine {
})
}
+ /// Deletes stale records from memory and IndexedDB after a server-side
+ /// mutation and resolves to affected local operation ids.
+ #[wasm_bindgen(js_name = deleteKeys)]
+ pub fn delete_keys(&self, keys: Vec<String>) -> js_sys::Promise {
+ let engine = self.engine.clone();
+ let ops = self.ops.clone();
+ future_to_promise(async move {
+ let keys: Vec<EntityKey> = keys.into_iter().map(EntityKey).collect();
+ let affected = engine
+ .lock()
+ .await
+ .delete_keys(&keys)
+ .await
+ .map_err(err_js)?;
+ to_js(&ops.borrow().names(affected))
+ })
+ }
+
/// Reloads optimistic layers after another engine changes the durable
/// queue and returns locally affected operations.
#[wasm_bindgen(js_name = refreshOptimisticQueue)]
diff --git a/crates/client/cache-wasm/tests/web.rs b/crates/client/cache-wasm/tests/web.rs
index ef4bca4b7d..851e3ecb10 100644
--- a/crates/client/cache-wasm/tests/web.rs
+++ b/crates/client/cache-wasm/tests/web.rs
@@ -11,7 +11,17 @@ use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
const QUERY: &str = r#"query Soup($input: SoupInput!) {
- user { id soup(input: $input) { nextCursor hasMore items { id } } }
+ user {
+ id
+ soup(input: $input) {
+ nextCursor
+ hasMore
+ items {
+ __typename
+ id
+ }
+ }
+ }
}"#;
fn js(json: serde_json::Value) -> JsValue {
@@ -27,7 +37,14 @@ async fn write_then_read_through_js_boundary() {
let vars = serde_json::json!({"input": {"limit": 1}});
let data = serde_json::json!({
- "user": { "id": "user-1", "soup": { "nextCursor": null, "hasMore": false, "items": [{"id": "doc-1"}] } }
+ "user": {
+ "id": "user-1",
+ "soup": {
+ "nextCursor": null,
+ "hasMore": false,
+ "items": [{ "__typename": "GraphqlSoupDocument", "id": "doc-1" }]
+ }
+ }
});
// Miss first.
@@ -59,6 +76,10 @@ async fn write_then_read_through_js_boundary() {
assert_eq!(write["affectedOps"], serde_json::json!(["tab1:1"]));
assert_eq!(write["reset"], serde_json::json!(false));
+ let identity = JsFuture::from(engine.bound_identity()).await.unwrap();
+ let identity: Option<String> = serde_wasm_bindgen::from_value(identity).unwrap();
+ assert_eq!(identity.as_deref(), Some("user-1"));
+
// Hit now; data is a plain JS object round-tripped exactly.
let read = JsFuture::from(engine.read_query(
Some("tab1:1".into()),
@@ -87,12 +108,39 @@ async fn write_then_read_through_js_boundary() {
// Cross-instance invalidation path: evict + report local dependents.
let affected =
- JsFuture::from(engine.invalidate_keys(vec!["GraphqlSoupItem:doc-1".to_string()]))
+ JsFuture::from(engine.invalidate_keys(vec!["GraphqlSoupDocument:doc-1".to_string()]))
.await
.unwrap();
let affected: Vec<String> = serde_wasm_bindgen::from_value(affected).unwrap();
assert_eq!(affected, vec!["tab1:1".to_string()]);
+ // External invalidation keeps the shared cold-tier record, while local
+ // mutation invalidation removes it from both tiers.
+ let read = JsFuture::from(engine.read_query(
+ Some("tab1:1".into()),
+ QUERY.into(),
+ Some("Soup".into()),
+ js(vars.clone()),
+ ))
+ .await
+ .unwrap();
+ let read: serde_json::Value = serde_wasm_bindgen::from_value(read).unwrap();
+ assert_eq!(read["kind"], "hit");
+
+ JsFuture::from(engine.delete_keys(vec!["GraphqlSoupDocument:doc-1".to_string()]))
+ .await
+ .unwrap();
+ let read = JsFuture::from(engine.read_query(
+ Some("tab1:1".into()),
+ QUERY.into(),
+ Some("Soup".into()),
+ js(vars),
+ ))
+ .await
+ .unwrap();
+ let read: serde_json::Value = serde_wasm_bindgen::from_value(read).unwrap();
+ assert_eq!(read["kind"], "miss");
+
// Lifecycle: close the connection, then deletion completes (would hang
// on a live connection without versionchange auto-close).
JsFuture::from(engine.close()).await.unwrap();
@@ -100,10 +148,11 @@ async fn write_then_read_through_js_boundary() {
}
const PROPERTY_QUERY: &str = r#"query Soup($input: SoupInput!) {
- user { id soup(input: $input) { hasMore items { id entity {
+ user { id soup(input: $input) { hasMore items {
__typename
- ... on GraphqlSoupDocument { id properties { id displayName } }
- } } } }
+ id
+ ... on GraphqlSoupDocument { properties { id displayName } }
+ } } }
}"#;
const PROPERTY_MUTATION: &str = r#"mutation SetEntityProperty($input: SetEntityPropertyInput!) {
@@ -120,12 +169,9 @@ async fn optimistic_write_round_trip() {
let vars = serde_json::json!({"input": {"limit": 1}});
let base = serde_json::json!({
"user": { "id": "user-1", "soup": { "hasMore": false, "items": [{
- "id": "item-1",
- "entity": {
- "__typename": "GraphqlSoupDocument",
- "id": "doc-1",
- "properties": [{ "id": "prop-1", "displayName": "Status" }]
- }
+ "__typename": "GraphqlSoupDocument",
+ "id": "doc-1",
+ "properties": [{ "id": "prop-1", "displayName": "Status" }]
}] } }
});
JsFuture::from(engine.write_query(
@@ -189,7 +235,7 @@ async fn optimistic_write_round_trip() {
.unwrap();
let read: serde_json::Value = serde_wasm_bindgen::from_value(read).unwrap();
assert_eq!(
- read["data"]["user"]["soup"]["items"][0]["entity"]["properties"][0]["displayName"],
+ read["data"]["user"]["soup"]["items"][0]["properties"][0]["displayName"],
serde_json::json!("Stage")
);
diff --git a/crates/complete_graph/AGENTS.md b/crates/complete_graph/AGENTS.md
index 96f29f12b2..7478d35c58 100644
--- a/crates/complete_graph/AGENTS.md
+++ b/crates/complete_graph/AGENTS.md
@@ -1,11 +1,12 @@
# complete_graph — schema conventions
This crate composes the domain GraphQL adapter crates (`graphql_soup`,
-`graphql_properties`, `graphql_notification`, `graphql_email`, with shared plumbing in
-`graphql_common`) into the complete GraphQL schema consumed by the client's
+`graphql_properties`, `graphql_notification`, `graphql_email`,
+`graphql_entity_mutation`, with shared plumbing in `graphql_common`) into the
+complete GraphQL schema consumed by the client's
**normalized cache** (`crates/client`, design doc:
-`apps/web/docs/graphql-normalized-cache-plan.md`). Two field-naming
-conventions in this schema are load-bearing for cache correctness. The
+`apps/web/docs/graphql-normalized-cache-plan.md`). The conventions below are
+load-bearing for cache correctness and API consistency. The
cache's build validates *shapes* but cannot validate *semantics* — that's
what schema review is for.
@@ -29,6 +30,11 @@ Clients key cache records by `__typename:id`. Consequences:
This is correct for value objects and query-scoped wrappers. Do **not**
add constant or synthetic ids to such types — a constant id (e.g.
`"soup_page"`) would merge every instance into a single record globally.
+ A type without an `id` may only carry fields that are facts about the
+ edge it represents, never facts about an entity — entity facts belong on
+ the entity record where every view shares them. Soup pages therefore
+ return entities directly (there is no per-item wrapper type), and
+ per-view state is limited to list membership and order.
- `id` fields must be exactly `ID!` (non-null, non-list); the cache build
(`crates/client/cache-core/build.rs`) fails otherwise, and fails if
the query root exposes an `id`.
@@ -55,6 +61,26 @@ account switches).
- New user-scoped root data should be added under `GraphqlUser`, not as
new root fields.
+## 3. `GraphqlSoupEntity` owns the shared entity contract
+
+Every field implemented by all concrete Soup entity types belongs on the
+`GraphqlSoupEntity` interface. Today that contract is `id`, `entityType`,
+`displayName`, `metadata`, `properties`, `notifications`, `isFavorited`, and
+`viewerPermission`.
+
+`content` is deliberately not part of the interface. Content has different
+domain shapes and loading policies across documents, email threads, channels,
+messages, calls, and future entity types. Define it on the concrete entity or a
+domain-specific composed edge, with the type that domain actually owns.
+
+The interface is the public API contract; Rust crate ownership must not leak
+into it. Cross-domain resolvers remain composed by `SoupEdges` in this crate,
+while `graphql_soup`'s `SoupEntityEdges` trait declares their associated output
+types and resolver contract. Adding a field to all concrete entity types
+therefore also requires adding it to the interface and its SDL contract test.
+Expensive fields remain lazy because GraphQL only invokes resolvers selected by
+a query.
+
## Regenerating the SDL
After schema changes:
diff --git a/crates/complete_graph/Cargo.toml b/crates/complete_graph/Cargo.toml
index 9df69def8c..2364d35c60 100644
--- a/crates/complete_graph/Cargo.toml
+++ b/crates/complete_graph/Cargo.toml
@@ -16,9 +16,13 @@ email = { path = "../email", default-features = false, features = [
entity_access = { path = "../entity_access", default-features = false, features = [
"inbound",
] }
+entity_mutation = { path = "../entity_mutation" }
graphql_common = { path = "../graphql_common" }
graphql_email = { path = "../graphql_email" }
+graphql_entity_mutation = { path = "../graphql_entity_mutation" }
+graphql_favorite = { path = "../graphql_favorite" }
graphql_notification = { path = "../graphql_notification" }
+graphql_permission = { path = "../graphql_permission" }
graphql_properties = { path = "../graphql_properties" }
graphql_soup = { path = "../graphql_soup" }
macro_authorization = { path = "../macro_authorization", features = [
diff --git a/crates/complete_graph/src/edges.rs b/crates/complete_graph/src/edges.rs
index 5b827c96e1..13e79e38a5 100644
--- a/crates/complete_graph/src/edges.rs
+++ b/crates/complete_graph/src/edges.rs
@@ -4,70 +4,120 @@ use async_graphql::{Context, Object};
use graphql_email::{
EmailContentKey, GraphqlSoupEmailMessage, SoupEmailContentEdgeReader, load_latest_email_message,
};
+use graphql_favorite::{EntityFavoriteEdgeReader, load_entity_favorite};
use graphql_notification::{
GraphqlSoupNotification, SoupNotificationEdgeReader, load_entity_notifications,
};
+use graphql_permission::{
+ EntityPermissionEdgeReader, GraphqlEntityPermission, load_entity_permission,
+};
use graphql_properties::{EntityPropertyReader, GraphqlProperty, load_entity_properties};
use graphql_soup::SoupEntityEdges;
use uuid::Uuid;
/// The types of the edge readers for soup
-type EdgeReaders<NR, PR, ER> = PhantomData<fn() -> (NR, PR, ER)>;
+type EdgeReaders<NR, PR, ER, FR, AR> = PhantomData<fn() -> (NR, PR, ER, FR, AR)>;
-/// Notification, property, and email-content fields attached to Soup entities.
+/// Notification, property, email-content, favorite, and permission fields
+/// attached to Soup entities.
///
/// This concrete edge shape lives in the composition crate so `graphql_soup`
/// does not know which cross-domain fields are attached to its objects.
-pub struct SoupEdges<NR, PR, ER> {
+pub struct SoupEdges<NR, PR, ER, FR, AR> {
/// Entity whose cross-domain fields are being resolved.
entity: model_entity::Entity<'static>,
+ /// Entity whose access determines the viewer permission for this object.
+ permission_entity: model_entity::Entity<'static>,
/// Associates the edge with its configured reader types.
- _readers: EdgeReaders<NR, PR, ER>,
+ _readers: EdgeReaders<NR, PR, ER, FR, AR>,
}
-impl<NR, PR, ER> Clone for SoupEdges<NR, PR, ER> {
+impl<NR, PR, ER, FR, AR> Clone for SoupEdges<NR, PR, ER, FR, AR> {
fn clone(&self) -> Self {
Self {
entity: self.entity.clone(),
+ permission_entity: self.permission_entity.clone(),
_readers: PhantomData,
}
}
}
-impl<NR, PR, ER> SoupEntityEdges for SoupEdges<NR, PR, ER>
+impl<NR, PR, ER, FR, AR> SoupEntityEdges for SoupEdges<NR, PR, ER, FR, AR>
where
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
+ type Property = GraphqlProperty;
+ type Notification = GraphqlSoupNotification;
type EmailThreadEdges = SoupEmailThreadEdges<ER>;
fn from_entity(entity: model_entity::Entity<'static>) -> Self {
Self {
+ permission_entity: entity.clone(),
entity,
_readers: PhantomData,
}
}
+ fn from_channel_message(message_id: Uuid, channel_id: Uuid) -> Self {
+ Self {
+ entity: model_entity::EntityType::ChannelMessage
+ .with_entity_string(message_id.to_string()),
+ permission_entity: model_entity::EntityType::Channel
+ .with_entity_string(channel_id.to_string()),
+ _readers: PhantomData,
+ }
+ }
+
fn email_thread_edges(thread_id: Uuid) -> Self::EmailThreadEdges {
SoupEmailThreadEdges {
thread_id,
_reader: PhantomData,
}
}
+
+ async fn resolve_properties(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<Vec<Self::Property>> {
+ load_entity_properties::<PR>(ctx, self.entity.clone()).await
+ }
+
+ async fn resolve_notifications(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<Vec<Self::Notification>> {
+ load_entity_notifications::<NR>(ctx, self.entity.clone()).await
+ }
+
+ async fn resolve_is_favorited(&self, ctx: &Context<'_>) -> async_graphql::Result<bool> {
+ load_entity_favorite::<FR>(ctx, self.entity.clone()).await
+ }
+
+ async fn resolve_viewer_permission(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<Option<GraphqlEntityPermission>> {
+ load_entity_permission::<AR>(ctx, self.permission_entity.clone()).await
+ }
}
/// Cross-domain fields attached to a property-bearing Soup entity.
#[Object(name = "SoupEdges")]
-impl<NR, PR, ER> SoupEdges<NR, PR, ER>
+impl<NR, PR, ER, FR, AR> SoupEdges<NR, PR, ER, FR, AR>
where
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
/// Properties assigned to this entity that the authenticated user may view.
async fn properties(&self, ctx: &Context<'_>) -> async_graphql::Result<Vec<GraphqlProperty>> {
- load_entity_properties::<PR>(ctx, self.entity.clone()).await
+ self.resolve_properties(ctx).await
}
/// Notifications associated with this entity for the authenticated user.
@@ -75,7 +125,20 @@ where
&self,
ctx: &Context<'_>,
) -> async_graphql::Result<Vec<GraphqlSoupNotification>> {
- load_entity_notifications::<NR>(ctx, self.entity.clone()).await
+ self.resolve_notifications(ctx).await
+ }
+
+ /// Whether the authenticated viewer has favorited this entity.
+ async fn is_favorited(&self, ctx: &Context<'_>) -> async_graphql::Result<bool> {
+ self.resolve_is_favorited(ctx).await
+ }
+
+ /// The authenticated viewer's effective permission for this entity.
+ async fn viewer_permission(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<Option<GraphqlEntityPermission>> {
+ self.resolve_viewer_permission(ctx).await
}
}
diff --git a/crates/complete_graph/src/lib.rs b/crates/complete_graph/src/lib.rs
index 698ef07a01..fae7e71bf6 100644
--- a/crates/complete_graph/src/lib.rs
+++ b/crates/complete_graph/src/lib.rs
@@ -1,6 +1,7 @@
//! Composition of the domain GraphQL adapter crates (`graphql_soup`,
-//! `graphql_properties`, `graphql_notification`, `graphql_email`) into the complete schema
-//! served by `document_storage_service` and exported as SDL.
+//! `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)]
#![deny(clippy::missing_docs_in_private_items)]
@@ -17,9 +18,25 @@ pub use graphql_email::{
EmailContentKey, EmailContentLoad, EmailContentLoader, EmailServiceEmailContentReader,
NoOpSoupEmailContentEdgeReader, SoupEmailContentEdgeReader, email_content_loader,
};
+pub use graphql_entity_mutation::{
+ ChannelSharePolicyInput, DuplicateEntityInput, EntityMutationPayload, EntityMutationRoot,
+ EntityRefInput, EntitySharePolicyInput, GraphqlEntityMutationError,
+ GraphqlEntityMutationErrorCode, GraphqlEntityMutationRef, GraphqlEntityMutationResult,
+ GraphqlMutationError, GraphqlMutationSuccess, GraphqlSharePolicyOperation, MoveEntityInput,
+ RenameEntityInput, UpdateEntitySharePolicyInput,
+};
+pub use graphql_favorite::{
+ EntityFavoriteEdgeReader, EntityFavoriteLoader, entity_favorite_loader,
+};
pub use graphql_notification::{
EntityNotificationsLoader, SoupNotificationEdgeReader, entity_notifications_loader,
};
+pub use graphql_permission::{
+ EntityPermissionEdgeReader, EntityPermissionLoader, GraphqlAccessLevelPermission,
+ GraphqlChannelParticipantRole, GraphqlChannelRolePermission, GraphqlChannelViewOnlyPermission,
+ GraphqlEntityAccessLevel, GraphqlEntityPermission, GraphqlTeamRole, GraphqlTeamRolePermission,
+ entity_permission_loader,
+};
pub use graphql_properties::{
EntityPropertiesLoader, EntityPropertyReader, EntityPropertyWriter, NoOpEntityPropertyReader,
PropertiesEntityPropertyReader, PropertiesEntityPropertyWriter, PropertiesMutationRoot,
diff --git a/crates/complete_graph/src/schema.rs b/crates/complete_graph/src/schema.rs
index 3cf717c914..a7c42cbcd1 100644
--- a/crates/complete_graph/src/schema.rs
+++ b/crates/complete_graph/src/schema.rs
@@ -3,22 +3,26 @@ mod test;
use std::{marker::PhantomData, sync::Arc};
-use async_graphql::{Context, Object, Schema, Subscription};
+use async_graphql::{Context, MergedObject, Object, Schema, Subscription};
use axum::extract::FromRef;
use email::{
domain::ports::{EmailService, NoOpEmailService},
inbound::axum::previews_router::EmailRouterState,
};
use entity_access::domain::ports::{EntityAccessService, NoOpEntityAccessService};
+use entity_mutation::{EntityMutationService, UnavailableEntityMutationService};
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_permission::{EntityPermissionEdgeReader, NoOpEntityPermissionEdgeReader};
use graphql_properties::{
EntityPropertyReader, EntityPropertyWriter, NoOpEntityPropertyReader, NoOpEntityPropertyWriter,
PropertiesMutationRoot,
};
use graphql_soup::{
- GraphqlSoupItem, GroupedSoup, GroupedSoupInput, SoupInput, SoupPage, resolve_grouped_soup,
+ GraphqlSoupEntity, GroupedSoup, GroupedSoupInput, SoupInput, SoupPage, resolve_grouped_soup,
resolve_soup, resolve_soup_updates,
};
use macro_authorization::{
@@ -33,22 +37,41 @@ 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.
+#[derive(MergedObject)]
+pub struct CompleteMutationRoot<W: EntityPropertyWriter, M: EntityMutationService>(
+ PropertiesMutationRoot<W>,
+ EntityMutationRoot<M>,
+);
+
+impl<W: EntityPropertyWriter, M: EntityMutationService> CompleteMutationRoot<W, M> {
+ /// Construct the composed mutation root.
+ fn new() -> Self {
+ Self(
+ PropertiesMutationRoot::<W>::new(),
+ EntityMutationRoot::<M>::new(),
+ )
+ }
+}
+
/// GraphQL Soup schema type.
///
/// `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, `NR` the notification edge reader, `PR` the property edge reader,
-/// and `ER` the email-content edge reader.
-pub type SoupSchema<S, R, E, EAS, Auth, St, W, NR, PR, ER> = Schema<
- SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER>,
- PropertiesMutationRoot<W>,
- SoupSubscriptionRoot<R, Auth, St, NR, PR, ER>,
+/// 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<
+ SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER, FR, AR>,
+ CompleteMutationRoot<W, M>,
+ 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, NR, PR, ER> =
- SoupSchema<Arc<S>, Arc<R>, E, EAS, Auth, St, W, NR, PR, ER>;
+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>;
/// GraphQL Soup schema type backed by the no-op services, used only for
/// SDL export or introspection.
@@ -60,9 +83,12 @@ pub type SchemaOnlySoupSchema = SoupSchema<
SchemaOnlyAuthorizationService,
SchemaOnlyState,
NoOpEntityPropertyWriter,
+ UnavailableEntityMutationService,
NoOpSoupNotificationEdgeReader,
NoOpEntityPropertyReader,
NoOpSoupEmailContentEdgeReader,
+ NoOpEntityFavoriteEdgeReader,
+ NoOpEntityPermissionEdgeReader,
>;
/// Authorization service used only to construct the GraphQL schema for SDL export.
@@ -100,18 +126,20 @@ impl FromRef<SchemaOnlyState> for MacroAuthorizationState<SchemaOnlyAuthorizatio
/// Zero-sized marker tying the query objects to the adapter, authorization,
/// state, and reader generics without requiring values of those types.
-type ServicesMarker<E, EAS, Auth, St, NR, PR, ER> =
- PhantomData<fn() -> (E, EAS, Auth, St, NR, PR, ER)>;
+type ServicesMarker<E, EAS, Auth, St, NR, PR, ER, FR, AR> =
+ PhantomData<fn() -> (E, EAS, Auth, St, NR, PR, ER, FR, AR)>;
/// Root GraphQL query object for Soup.
-pub struct SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER> {
+pub struct SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER, FR, AR> {
/// Soup domain service used by user-scoped query resolvers.
service: S,
/// Associates the root with its adapter and reader types.
- _marker: ServicesMarker<E, EAS, Auth, St, NR, PR, ER>,
+ _marker: ServicesMarker<E, EAS, Auth, St, NR, PR, ER, FR, AR>,
}
-impl<S, E, EAS, Auth, St, NR, PR, ER> SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER> {
+impl<S, E, EAS, Auth, St, NR, PR, ER, FR, AR>
+ SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER, FR, AR>
+{
/// Create a root GraphQL query object.
pub fn new(service: S) -> Self {
Self {
@@ -122,15 +150,15 @@ impl<S, E, EAS, Auth, St, NR, PR, ER> SoupQueryRoot<S, E, EAS, Auth, St, NR, PR,
}
/// Root GraphQL subscription object for realtime Soup updates.
-pub struct SoupSubscriptionRoot<R, Auth, St, NR, PR, ER> {
+pub struct SoupSubscriptionRoot<R, Auth, St, NR, PR, ER, FR, AR> {
/// Realtime Soup service used by user-scoped subscriptions.
service: R,
/// Associates the root with authorization, state, and edge reader types.
#[allow(clippy::type_complexity)]
- _marker: PhantomData<fn() -> (Auth, St, NR, PR, ER)>,
+ _marker: PhantomData<fn() -> (Auth, St, NR, PR, ER, FR, AR)>,
}
-impl<R, Auth, St, NR, PR, ER> SoupSubscriptionRoot<R, Auth, St, NR, PR, ER> {
+impl<R, Auth, St, NR, PR, ER, FR, AR> SoupSubscriptionRoot<R, Auth, St, NR, PR, ER, FR, AR> {
/// Creates a root GraphQL subscription object.
pub fn new(service: R) -> Self {
Self {
@@ -143,11 +171,11 @@ impl<R, Auth, St, NR, PR, ER> SoupSubscriptionRoot<R, Auth, St, NR, PR, ER> {
/// The authenticated user (viewer). All user-scoped data hangs off this
/// object so clients (and their normalized caches) observe data ownership
/// structurally rather than implicitly through the session.
-pub struct GraphqlUser<S, E, EAS, Auth, St, NR, PR, ER> {
+pub struct GraphqlUser<S, E, EAS, Auth, St, NR, PR, ER, FR, AR> {
/// Soup domain service used by this user's resolvers.
service: S,
/// Associates the user object with its adapter and reader types.
- _marker: ServicesMarker<E, EAS, Auth, St, NR, PR, ER>,
+ _marker: ServicesMarker<E, EAS, Auth, St, NR, PR, ER, FR, AR>,
/// The [MacroUserIdStr] of the resolving user
user_id: MacroUserIdStr<'static>,
}
@@ -158,9 +186,10 @@ pub fn build_schema() -> SchemaOnlySoupSchema {
}
/// Build a GraphQL schema backed by a query service and no-op realtime service.
-pub fn build_schema_with_service<S, E, EAS, Auth, St, W, NR, PR, ER>(
+#[allow(clippy::type_complexity)]
+pub fn build_schema_with_service<S, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
service: S,
-) -> SoupSchema<S, NoOpSoupRealtimeSubscriptionService, E, EAS, Auth, St, W, NR, PR, ER>
+) -> SoupSchema<S, NoOpSoupRealtimeSubscriptionService, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>
where
S: SoupService + Clone,
E: EmailService,
@@ -171,18 +200,22 @@ where
Arc<EAS>: FromRef<St>,
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
+ M: EntityMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
build_schema_with_services(service, NoOpSoupRealtimeSubscriptionService)
}
/// Build a GraphQL schema backed by query and realtime Soup services.
-pub fn build_schema_with_services<S, R, E, EAS, Auth, St, W, NR, PR, ER>(
+#[allow(clippy::type_complexity)]
+pub fn build_schema_with_services<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
service: S,
realtime_service: R,
-) -> SoupSchema<S, R, E, EAS, Auth, St, W, NR, PR, ER>
+) -> SoupSchema<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>
where
S: SoupService + Clone,
R: SoupRealtimeSubscriptionService + Clone,
@@ -194,22 +227,40 @@ where
Arc<EAS>: FromRef<St>,
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
+ M: EntityMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
Schema::build(
SoupQueryRoot::new(service),
- PropertiesMutationRoot::<W>::new(),
+ CompleteMutationRoot::<W, M>::new(),
SoupSubscriptionRoot::new(realtime_service),
)
.finish()
}
/// Build a GraphQL schema backed by an `Arc`-shared query service.
-pub fn build_schema_from_arc<S, E, EAS, Auth, St, W, NR, PR, ER>(
+#[allow(clippy::type_complexity)]
+pub fn build_schema_from_arc<S, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
service: Arc<S>,
-) -> SoupSchema<Arc<S>, NoOpSoupRealtimeSubscriptionService, E, EAS, Auth, St, W, NR, PR, ER>
+) -> SoupSchema<
+ Arc<S>,
+ NoOpSoupRealtimeSubscriptionService,
+ E,
+ EAS,
+ Auth,
+ St,
+ W,
+ M,
+ NR,
+ PR,
+ ER,
+ FR,
+ AR,
+>
where
S: SoupService,
E: EmailService,
@@ -220,18 +271,22 @@ where
Arc<EAS>: FromRef<St>,
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
+ M: EntityMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
build_schema_with_service(service)
}
/// Build a GraphQL schema backed by `Arc`-shared query and realtime services.
-pub fn build_schema_from_arcs<S, R, E, EAS, Auth, St, W, NR, PR, ER>(
+#[allow(clippy::type_complexity)]
+pub fn build_schema_from_arcs<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>(
service: Arc<S>,
realtime_service: Arc<R>,
-) -> SharedSoupSchema<S, R, E, EAS, Auth, St, W, NR, PR, ER>
+) -> SharedSoupSchema<S, R, E, EAS, Auth, St, W, M, NR, PR, ER, FR, AR>
where
S: SoupService,
R: SoupRealtimeSubscriptionService,
@@ -243,16 +298,19 @@ where
Arc<EAS>: FromRef<St>,
MacroAuthorizationState<Auth>: FromRef<St>,
W: EntityPropertyWriter,
+ M: EntityMutationService,
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
build_schema_with_services(service, realtime_service)
}
/// Root entry point for the complete GraphQL API.
#[Object]
-impl<S, E, EAS, Auth, St, NR, PR, ER> SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER>
+impl<S, E, EAS, Auth, St, NR, PR, ER, FR, AR> SoupQueryRoot<S, E, EAS, Auth, St, NR, PR, ER, FR, AR>
where
S: SoupService + Clone,
E: EmailService,
@@ -265,12 +323,14 @@ where
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
/// The authenticated user.
async fn user(
&self,
ctx: &Context<'_>,
- ) -> async_graphql::Result<GraphqlUser<S, E, EAS, Auth, St, NR, PR, ER>> {
+ ) -> async_graphql::Result<GraphqlUser<S, E, EAS, Auth, St, NR, PR, ER, FR, AR>> {
let user_id = require_authorized_user::<Auth, St>(ctx).await?;
Ok(GraphqlUser {
@@ -283,7 +343,7 @@ where
/// Root entry point for realtime Soup subscriptions.
#[Subscription]
-impl<R, Auth, St, NR, PR, ER> SoupSubscriptionRoot<R, Auth, St, NR, PR, ER>
+impl<R, Auth, St, NR, PR, ER, FR, AR> SoupSubscriptionRoot<R, Auth, St, NR, PR, ER, FR, AR>
where
R: SoupRealtimeSubscriptionService,
Auth: MacroAuthorizationService,
@@ -292,21 +352,25 @@ where
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
/// Subscribe to realtime Soup updates for the authenticated user.
async fn soup_updates(
&self,
ctx: &Context<'_>,
) -> async_graphql::Result<
- impl async_graphql::futures_util::Stream<Item = GraphqlSoupItem<SoupEdges<NR, PR, ER>>>,
+ impl async_graphql::futures_util::Stream<
+ Item = GraphqlSoupEntity<SoupEdges<NR, PR, ER, FR, AR>>,
+ >,
> {
- resolve_soup_updates::<R, Auth, St, SoupEdges<NR, PR, ER>>(&self.service, ctx).await
+ resolve_soup_updates::<R, Auth, St, SoupEdges<NR, PR, ER, FR, AR>>(&self.service, ctx).await
}
}
/// The authenticated user and their user-scoped data.
#[Object(name = "GraphqlUser")]
-impl<S, E, EAS, Auth, St, NR, PR, ER> GraphqlUser<S, E, EAS, Auth, St, NR, PR, ER>
+impl<S, E, EAS, Auth, St, NR, PR, ER, FR, AR> GraphqlUser<S, E, EAS, Auth, St, NR, PR, ER, FR, AR>
where
S: SoupService,
E: EmailService,
@@ -319,6 +383,8 @@ where
NR: SoupNotificationEdgeReader,
PR: EntityPropertyReader,
ER: SoupEmailContentEdgeReader,
+ FR: EntityFavoriteEdgeReader,
+ AR: EntityPermissionEdgeReader,
{
/// Stable id of the authenticated user.
async fn id(&self) -> async_graphql::ID {
@@ -330,8 +396,13 @@ where
&self,
ctx: &Context<'_>,
input: GroupedSoupInput,
- ) -> async_graphql::Result<GroupedSoup<SoupEdges<NR, PR, ER>>> {
- resolve_grouped_soup::<S, Auth, St, SoupEdges<NR, PR, ER>>(&self.service, ctx, input).await
+ ) -> async_graphql::Result<GroupedSoup<SoupEdges<NR, PR, ER, FR, AR>>> {
+ resolve_grouped_soup::<S, Auth, St, SoupEdges<NR, PR, ER, FR, AR>>(
+ &self.service,
+ ctx,
+ input,
+ )
+ .await
}
/// Fetch a page of Soup items using the existing Soup filter AST format.
@@ -339,7 +410,12 @@ where
&self,
ctx: &Context<'_>,
input: SoupInput,
- ) -> async_graphql::Result<SoupPage<SoupEdges<NR, PR, ER>>> {
- resolve_soup::<S, E, EAS, Auth, St, SoupEdges<NR, PR, ER>>(&self.service, ctx, input).await
+ ) -> async_graphql::Result<SoupPage<SoupEdges<NR, PR, ER, FR, AR>>> {
+ resolve_soup::<S, E, EAS, Auth, St, SoupEdges<NR, PR, ER, FR, AR>>(
+ &self.service,
+ ctx,
+ input,
+ )
+ .await
}
}
diff --git a/crates/complete_graph/src/schema/test.rs b/crates/complete_graph/src/schema/test.rs
index 351abe267e..571c91b1a7 100644
--- a/crates/complete_graph/src/schema/test.rs
+++ b/crates/complete_graph/src/schema/test.rs
@@ -502,9 +502,12 @@ struct TestHarness {
FakeAuthorizationService,
TestState,
NoOpEntityPropertyWriter,
+ UnavailableEntityMutationService,
NoOpSoupNotificationEdgeReader,
NoOpEntityPropertyReader,
NoOpSoupEmailContentEdgeReader,
+ graphql_favorite::NoOpEntityFavoriteEdgeReader,
+ graphql_permission::NoOpEntityPermissionEdgeReader,
>,
state: TestState,
authorization_calls: Arc<AtomicUsize>,
@@ -605,12 +608,15 @@ async fn soup_updates_subscribes_as_the_authenticated_user() {
SchemaOnlyAuthorizationService,
SchemaOnlyState,
NoOpEntityPropertyWriter,
+ UnavailableEntityMutationService,
NoOpSoupNotificationEdgeReader,
NoOpEntityPropertyReader,
NoOpSoupEmailContentEdgeReader,
+ NoOpEntityFavoriteEdgeReader,
+ NoOpEntityPermissionEdgeReader,
> = build_schema_with_services(NoOpSoupService, realtime);
let request = async_graphql::Request::new(
- "subscription { soupUpdates { id entityType entity { __typename ... on GraphqlSoupDocument { id name } } } }",
+ "subscription { soupUpdates { id entityType ... on GraphqlSoupDocument { name } } }",
)
.data(user_id.clone());
let responses = schema.execute_stream(request);
@@ -628,7 +634,7 @@ async fn soup_updates_subscribes_as_the_authenticated_user() {
assert_eq!(data["soupUpdates"]["id"], document_id.to_string());
assert_eq!(data["soupUpdates"]["entityType"], "DOCUMENT");
assert_eq!(
- data["soupUpdates"]["entity"]["name"],
+ data["soupUpdates"]["name"],
format!("Document {document_id}")
);
assert_eq!(
diff --git a/crates/complete_graph/src/sdl_test.rs b/crates/complete_graph/src/sdl_test.rs
index b37a7e8ed0..21e4fe3ca1 100644
--- a/crates/complete_graph/src/sdl_test.rs
+++ b/crates/complete_graph/src/sdl_test.rs
@@ -3,15 +3,15 @@ fn soup_response_schema_exposes_frontend_fields() {
let sdl = crate::build_schema().sdl();
for expected in [
- "type GraphqlSoupChannel {",
+ "type GraphqlSoupChannel implements GraphqlSoupEntity {",
"organizationId: ID",
"interactedAt: String",
"isParticipant: Boolean!",
"participantIds: [String!]!",
"participants: [GraphqlSoupChannelParticipant!]!",
- "latestMessage: GraphqlSoupChannelMessage",
- "latestNonThreadMessage: GraphqlSoupChannelMessage",
- "type GraphqlSoupEmailThread {",
+ "latestMessage: GraphqlSoupChannelMessagePreview",
+ "latestNonThreadMessage: GraphqlSoupChannelMessagePreview",
+ "type GraphqlSoupEmailThread implements GraphqlSoupEntity {",
"providerId: String",
"inboxVisible: Boolean!",
"linkId: ID",
@@ -25,20 +25,86 @@ fn soup_response_schema_exposes_frontend_fields() {
"bodyParsed: String",
"bodyHtmlSanitized: String",
"bodyReplyless: String",
- "type GraphqlSoupCall {",
+ "type GraphqlSoupCall implements GraphqlSoupEntity {",
"channelName: String",
"customName: String",
"status: String!",
"participantIds: [String!]!",
"participants: [GraphqlSoupCallParticipant!]!",
- "type GraphqlSoupChat {",
+ "type GraphqlSoupChat implements GraphqlSoupEntity {",
"deletedAt: String",
- "type GraphqlSoupProject {",
+ "type GraphqlSoupProject implements GraphqlSoupEntity {",
+ "parent: GraphqlEntity",
"type SoupSubscriptionRoot {",
- "soupUpdates: GraphqlSoupItem!",
+ "soupUpdates: GraphqlSoupEntity!",
] {
assert_sdl_line(&sdl, expected);
}
+ assert!(
+ !sdl.lines()
+ .any(|line| line.trim() == "type GraphqlEntityRef {"),
+ "Soup metadata must reuse the canonical GraphqlEntity object"
+ );
+}
+
+#[test]
+fn soup_interface_exposes_the_complete_shared_entity_contract() {
+ use apollo_compiler::schema::ExtendedType;
+
+ let schema =
+ apollo_compiler::Schema::parse_and_validate(crate::build_schema().sdl(), "schema.graphql")
+ .expect("generated SDL is valid");
+ let ExtendedType::Interface(entity) = schema
+ .types
+ .get("GraphqlSoupEntity")
+ .expect("Soup entity interface exists")
+ else {
+ panic!("GraphqlSoupEntity must be an interface");
+ };
+
+ for shared_field in [
+ "id",
+ "entityType",
+ "displayName",
+ "metadata",
+ "properties",
+ "notifications",
+ "isFavorited",
+ "viewerPermission",
+ "frecencyScore",
+ ] {
+ assert!(
+ entity.fields.contains_key(shared_field),
+ "Soup interface missing shared field {shared_field}"
+ );
+ }
+ assert!(
+ !schema.types.contains_key("GraphqlSoupItem"),
+ "soup items are entities directly; no query-scoped wrapper type"
+ );
+ assert!(
+ !entity.fields.contains_key("content"),
+ "entity-specific content must not be flattened into the shared Soup interface"
+ );
+
+ let ExtendedType::Object(document) = schema
+ .types
+ .get("GraphqlSoupDocument")
+ .expect("Soup document type exists")
+ else {
+ panic!("GraphqlSoupDocument must be an object");
+ };
+ for shared_field in [
+ "isFavorited",
+ "viewerPermission",
+ "properties",
+ "notifications",
+ ] {
+ assert!(
+ document.fields.contains_key(shared_field),
+ "Soup document missing shared field {shared_field}"
+ );
+ }
}
#[test]
diff --git a/crates/entity_mutation/src/lib.rs b/crates/entity_mutation/src/lib.rs
index 0ca97e93b5..0ef6883e17 100644
--- a/crates/entity_mutation/src/lib.rs
+++ b/crates/entity_mutation/src/lib.rs
@@ -8,12 +8,14 @@
/// Per-capability mutation traits implemented by each entity domain.
pub mod capability;
mod models;
+mod ports;
pub use capability::{
DeleteEntityPermanently, DuplicateEntity, MoveEntity, RenameEntity, RestoreEntity, TrashEntity,
UpdateEntitySharePolicy,
};
pub use models::{
- DuplicateEntityRequest, EntityMutationActor, EntityMutationErrorCode, MoveEntityRequest,
- RenameEntityRequest, UpdateEntitySharePolicyRequest,
+ DuplicateEntityRequest, EntityMutationActor, EntityMutationErrorCode, EntityMutationSuccess,
+ MoveEntityRequest, RenameEntityRequest, UpdateEntitySharePolicyRequest,
};
+pub use ports::{EntityMutationService, MutateEntitiesResult, UnavailableEntityMutationService};
diff --git a/crates/entity_mutation/src/models.rs b/crates/entity_mutation/src/models.rs
index bdbaaefd33..166231abab 100644
--- a/crates/entity_mutation/src/models.rs
+++ b/crates/entity_mutation/src/models.rs
@@ -102,4 +102,16 @@ impl EntityMutationErrorCode {
pub fn conflict<C, O, T>(err: rootcause::Report<C, O, T>) -> Self {
EntityMutationErrorCode::Conflict(Sentinel(()))
}
+
+ /// Construct a state-conflict error.
+ #[tracing::instrument(ret)]
+ pub fn unsupported<C, O, T>(err: rootcause::Report<C, O, T>) -> Self {
+ EntityMutationErrorCode::UnsupportedOperation(Sentinel(()))
+ }
+}
+
+/// the success case for the mutated entities
+pub struct EntityMutationSuccess<'a> {
+ /// the entities which were successfully modified
+ pub affected_entities: Vec<Entity<'a>>,
}
diff --git a/crates/entity_mutation/src/ports.rs b/crates/entity_mutation/src/ports.rs
new file mode 100644
index 0000000000..74e4e8e7c5
--- /dev/null
+++ b/crates/entity_mutation/src/ports.rs
@@ -0,0 +1,167 @@
+use std::future::Future;
+
+use model_entity::Entity;
+use rootcause::report;
+
+use crate::{
+ DuplicateEntityRequest, EntityMutationActor, EntityMutationErrorCode, MoveEntityRequest,
+ RenameEntityRequest, UpdateEntitySharePolicyRequest, models::EntityMutationSuccess,
+};
+
+/// type alias for the result of a singular entity mutation, the success case can hold multiple affected entities
+pub type MutateEntitiesResult<'a> = Result<EntityMutationSuccess<'a>, EntityMutationErrorCode>;
+
+/// Domain port used by API adapters to mutate heterogeneous entities.
+///
+/// Methods are batch-oriented because the UI performs these actions across
+/// selections. Each input always produces one ordered outcome, so cross-service
+/// partial success is explicit and no false transaction boundary is implied.
+pub trait EntityMutationService: Send + Sync + 'static {
+ /// Rename entities using the canonical `display_name` concept.
+ fn rename_entities(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<RenameEntityRequest>,
+ ) -> impl Future<Output = Vec<MutateEntitiesResult<'static>>> + Send;
+
+ /// Move entities into a project, or to the root when `project_id` is absent.
+ fn move_entities(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<MoveEntityRequest>,
+ ) -> impl Future<Output = Vec<MutateEntitiesResult<'static>>> + Send;
+
+ /// Update public and channel share policies.
+ fn update_share_policies(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<UpdateEntitySharePolicyRequest>,
+ ) -> impl Future<Output = Vec<MutateEntitiesResult<'static>>> + Send;
+
+ /// Soft-delete entities that support a reversible trash lifecycle.
+ fn trash_entities(
+ &self,
+ actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> impl Future<Output = Vec<MutateEntitiesResult<'static>>> + Send;
+
+ /// Restore reversibly deleted entities.
+ fn restore_entities(
+ &self,
+ actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> impl Future<Output = Vec<MutateEntitiesResult<'static>>> + Send;
+
+ /// Irreversibly delete entities.
+ fn delete_entities_permanently(
+ &self,
+ actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> impl Future<Output = Vec<MutateEntitiesResult<'static>>> + Send;
+
+ /// Duplicate entities that support copy semantics.
+ fn duplicate_entities(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<DuplicateEntityRequest>,
+ ) -> impl Future<Output = Vec<MutateEntitiesResult<'static>>> + Send;
+
+ /// Add or remove an entity from the actor's favorites.
+ fn set_favorite(
+ &self,
+ actor: EntityMutationActor,
+ entity: Entity<'static>,
+ favorite: bool,
+ ) -> impl Future<Output = MutateEntitiesResult<'static>> + Send;
+}
+
+/// Schema-only implementation used when no mutation services are wired.
+#[derive(Clone, Copy, Debug, Default)]
+pub struct UnavailableEntityMutationService;
+
+/// Build unsupported outcomes for a batch handled by the schema-only service.
+fn unsupported_many(
+ operation: &'static str,
+ entities: impl IntoIterator<Item = Entity<'static>>,
+) -> Vec<MutateEntitiesResult<'static>> {
+ entities
+ .into_iter()
+ .map(|entity| EntityMutationErrorCode::unsupported(report!(entity).attach(operation)))
+ .map(Result::Err)
+ .collect()
+}
+
+impl EntityMutationService for UnavailableEntityMutationService {
+ async fn rename_entities(
+ &self,
+ _actor: EntityMutationActor,
+ requests: Vec<RenameEntityRequest>,
+ ) -> Vec<MutateEntitiesResult<'static>> {
+ unsupported_many("rename", requests.into_iter().map(|request| request.entity))
+ }
+
+ async fn move_entities(
+ &self,
+ _actor: EntityMutationActor,
+ requests: Vec<MoveEntityRequest>,
+ ) -> Vec<MutateEntitiesResult<'static>> {
+ unsupported_many("move", requests.into_iter().map(|request| request.entity))
+ }
+
+ async fn update_share_policies(
+ &self,
+ _actor: EntityMutationActor,
+ requests: Vec<UpdateEntitySharePolicyRequest>,
+ ) -> Vec<MutateEntitiesResult<'static>> {
+ unsupported_many(
+ "share policy updates",
+ requests.into_iter().map(|request| request.entity),
+ )
+ }
+
+ async fn trash_entities(
+ &self,
+ _actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> Vec<MutateEntitiesResult<'static>> {
+ unsupported_many("trash", entities)
+ }
+
+ async fn restore_entities(
+ &self,
+ _actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> Vec<MutateEntitiesResult<'static>> {
+ unsupported_many("restore", entities)
+ }
+
+ async fn delete_entities_permanently(
+ &self,
+ _actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> Vec<MutateEntitiesResult<'static>> {
+ unsupported_many("permanent deletion", entities)
+ }
+
+ async fn duplicate_entities(
+ &self,
+ _actor: EntityMutationActor,
+ requests: Vec<DuplicateEntityRequest>,
+ ) -> Vec<MutateEntitiesResult<'static>> {
+ unsupported_many(
+ "duplication",
+ requests.into_iter().map(|request| request.entity),
+ )
+ }
+
+ async fn set_favorite(
+ &self,
+ _actor: EntityMutationActor,
+ entity: Entity<'static>,
+ _favorite: bool,
+ ) -> MutateEntitiesResult<'static> {
+ Err(EntityMutationErrorCode::unsupported(
+ report!(entity).attach("favorites"),
+ ))
+ }
+}
diff --git a/crates/graphql_common/Cargo.toml b/crates/graphql_common/Cargo.toml
index c140e2f0e3..12c0d7fc52 100644
--- a/crates/graphql_common/Cargo.toml
+++ b/crates/graphql_common/Cargo.toml
@@ -5,7 +5,7 @@ edition = "2024"
publish = false
[dependencies]
-async-graphql = { workspace = true }
+async-graphql = { workspace = true, features = ["dataloader"] }
axum = { workspace = true }
axum-extra = { workspace = true }
filter_ast = { path = "../filter_ast" }
@@ -14,6 +14,7 @@ macro_authorization = { path = "../macro_authorization", default-features = fals
macro_user_id = { path = "../macro_user_id" }
model-entity = { path = "../model-entity" }
models_properties = { path = "../models_properties" }
+rootcause = { workspace = true }
tokio = { workspace = true }
uuid = { workspace = true }
workspace-hack = { version = "0.1", path = "../workspace-hack" }
diff --git a/crates/graphql_common/src/entity_type.rs b/crates/graphql_common/src/entity_type.rs
index f3226a2be6..26b5fdd30f 100644
--- a/crates/graphql_common/src/entity_type.rs
+++ b/crates/graphql_common/src/entity_type.rs
@@ -1,8 +1,8 @@
-use async_graphql::Enum;
-use model_entity::EntityType;
+use async_graphql::{Enum, ID, Object};
+use model_entity::{Entity, EntityType};
/// GraphQL representation of Soup entity types.
-#[derive(Enum, Copy, Clone, Eq, PartialEq)]
+#[derive(Enum, Copy, Clone, Eq, PartialEq, Hash)]
pub enum GraphqlSoupEntityType {
/// Document entity.
Document,
@@ -14,8 +14,31 @@ pub enum GraphqlSoupEntityType {
EmailThread,
/// Channel entity.
Channel,
- /// Channel thread entity.
- ChannelThread,
+ /// Channel message entity.
+ ChannelMessage,
+ /// Call entity.
+ Call,
+ /// CRM company entity.
+ CrmCompany,
+ /// Foreign entity.
+ ForeignEntity,
+}
+
+/// Canonical entity types accepted by cross-entity APIs.
+#[derive(Enum, Copy, Clone, Eq, PartialEq, Hash)]
+pub enum GraphqlEntityType {
+ /// Document entity.
+ Document,
+ /// Chat entity.
+ Chat,
+ /// Project entity.
+ Project,
+ /// Email thread entity.
+ EmailThread,
+ /// Channel entity.
+ Channel,
+ /// Channel message entity.
+ ChannelMessage,
/// Call entity.
Call,
/// CRM company entity.
@@ -32,15 +55,49 @@ pub enum GraphqlSoupEntityType {
CrmContact,
}
-impl From<EntityType> for GraphqlSoupEntityType {
- fn from(entity_type: EntityType) -> Self {
+impl GraphqlSoupEntityType {
+ /// Construct a GraphQL Soup entity type from the canonical model type.
+ pub fn new(entity_type: EntityType) -> Self {
match entity_type {
EntityType::Document => Self::Document,
EntityType::Chat => Self::Chat,
EntityType::Project => Self::Project,
EntityType::EmailThread => Self::EmailThread,
EntityType::Channel => Self::Channel,
- EntityType::ChannelMessage => Self::ChannelThread,
+ EntityType::ChannelMessage => Self::ChannelMessage,
+ EntityType::Call => Self::Call,
+ EntityType::CrmCompany => Self::CrmCompany,
+ EntityType::ForeignEntity => Self::ForeignEntity,
+ unsupported => panic!("{unsupported} is not a Soup entity type"),
+ }
+ }
+
+ /// Convert this GraphQL Soup entity type into the canonical model type.
+ pub fn into_model(self) -> EntityType {
+ match self {
+ Self::Document => EntityType::Document,
+ Self::Chat => EntityType::Chat,
+ Self::Project => EntityType::Project,
+ Self::EmailThread => EntityType::EmailThread,
+ Self::Channel => EntityType::Channel,
+ Self::ChannelMessage => EntityType::ChannelMessage,
+ Self::Call => EntityType::Call,
+ Self::CrmCompany => EntityType::CrmCompany,
+ Self::ForeignEntity => EntityType::ForeignEntity,
+ }
+ }
+}
+
+impl GraphqlEntityType {
+ /// Construct a GraphQL entity type from the canonical model type.
+ pub fn new(entity_type: EntityType) -> Self {
+ match entity_type {
+ EntityType::Document => Self::Document,
+ EntityType::Chat => Self::Chat,
+ EntityType::Project => Self::Project,
+ EntityType::EmailThread => Self::EmailThread,
+ EntityType::Channel => Self::Channel,
+ EntityType::ChannelMessage => Self::ChannelMessage,
EntityType::Call => Self::Call,
EntityType::CrmCompany => Self::CrmCompany,
EntityType::ForeignEntity => Self::ForeignEntity,
@@ -50,4 +107,45 @@ impl From<EntityType> for GraphqlSoupEntityType {
EntityType::CrmContact => Self::CrmContact,
}
}
+
+ /// Construct a canonical GraphQL entity type from a Soup entity type.
+ pub fn new_from_soup_entity_type(entity_type: GraphqlSoupEntityType) -> Self {
+ Self::new(entity_type.into_model())
+ }
+
+ /// Convert this GraphQL entity type into the canonical model type.
+ pub fn into_model(self) -> EntityType {
+ match self {
+ Self::Document => EntityType::Document,
+ Self::Chat => EntityType::Chat,
+ Self::Project => EntityType::Project,
+ Self::EmailThread => EntityType::EmailThread,
+ Self::Channel => EntityType::Channel,
+ Self::ChannelMessage => EntityType::ChannelMessage,
+ Self::Call => EntityType::Call,
+ Self::CrmCompany => EntityType::CrmCompany,
+ Self::ForeignEntity => EntityType::ForeignEntity,
+ Self::User => EntityType::User,
+ Self::Team => EntityType::Team,
+ Self::StaticFile => EntityType::StaticFile,
+ Self::CrmContact => EntityType::CrmContact,
+ }
+ }
+}
+
+/// GraphQL wrapper over a canonical [`model_entity::Entity`].
+pub struct GraphqlEntity<'a>(pub Entity<'a>);
+
+/// Canonical reference to an entity.
+#[Object]
+impl<'a> GraphqlEntity<'a> {
+ /// The entity's canonical identifier.
+ async fn id(&self) -> ID {
+ ID(self.0.entity_id.to_string())
+ }
+
+ /// The entity's canonical type.
+ async fn entity_type(&self) -> GraphqlEntityType {
+ GraphqlEntityType::new(self.0.entity_type)
+ }
}
diff --git a/crates/graphql_common/src/lib.rs b/crates/graphql_common/src/lib.rs
index 3b6b013e29..3c1fe44c30 100644
--- a/crates/graphql_common/src/lib.rs
+++ b/crates/graphql_common/src/lib.rs
@@ -21,7 +21,7 @@ mod property_filter;
mod request_context;
pub use authorization::require_authorized_user;
-pub use entity_type::GraphqlSoupEntityType;
+pub use entity_type::{GraphqlEntity, GraphqlEntityType, GraphqlSoupEntityType};
pub use extract::extract_part;
pub use filter_input::{IntoFilterExpr, optional_tree, parse_id, parse_macro_user_id, parse_uuid};
pub use property_filter::{
diff --git a/crates/graphql_common/src/property_filter.rs b/crates/graphql_common/src/property_filter.rs
index c1f0317889..9778f332a7 100644
--- a/crates/graphql_common/src/property_filter.rs
+++ b/crates/graphql_common/src/property_filter.rs
@@ -91,24 +91,9 @@ pub enum GraphqlPropertyEntityType {
User,
}
-impl From<GraphqlPropertyEntityType> for models_properties::EntityType {
- fn from(value: GraphqlPropertyEntityType) -> Self {
- match value {
- GraphqlPropertyEntityType::CallRecord => Self::CallRecord,
- GraphqlPropertyEntityType::Channel => Self::Channel,
- GraphqlPropertyEntityType::Chat => Self::Chat,
- GraphqlPropertyEntityType::Company => Self::Company,
- GraphqlPropertyEntityType::Document => Self::Document,
- GraphqlPropertyEntityType::Project => Self::Project,
- GraphqlPropertyEntityType::Task => Self::Task,
- GraphqlPropertyEntityType::Thread => Self::Thread,
- GraphqlPropertyEntityType::User => Self::User,
- }
- }
-}
-
-impl From<models_properties::EntityType> for GraphqlPropertyEntityType {
- fn from(value: models_properties::EntityType) -> Self {
+impl GraphqlPropertyEntityType {
+ /// Construct a GraphQL property entity type from its properties-domain model.
+ pub fn new(value: models_properties::EntityType) -> Self {
match value {
models_properties::EntityType::CallRecord => Self::CallRecord,
models_properties::EntityType::Channel => Self::Channel,
@@ -121,6 +106,21 @@ impl From<models_properties::EntityType> for GraphqlPropertyEntityType {
models_properties::EntityType::User => Self::User,
}
}
+
+ /// Convert this GraphQL entity type into its properties-domain model.
+ pub fn into_model(self) -> models_properties::EntityType {
+ match self {
+ Self::CallRecord => models_properties::EntityType::CallRecord,
+ Self::Channel => models_properties::EntityType::Channel,
+ Self::Chat => models_properties::EntityType::Chat,
+ Self::Company => models_properties::EntityType::Company,
+ Self::Document => models_properties::EntityType::Document,
+ Self::Project => models_properties::EntityType::Project,
+ Self::Task => models_properties::EntityType::Task,
+ Self::Thread => models_properties::EntityType::Thread,
+ Self::User => models_properties::EntityType::User,
+ }
+ }
}
impl TryFrom<GraphqlPropertyEntityType> for PropertyEntityType {
diff --git a/crates/graphql_entity_mutation/Cargo.toml b/crates/graphql_entity_mutation/Cargo.toml
new file mode 100644
index 0000000000..8277aad88e
--- /dev/null
+++ b/crates/graphql_entity_mutation/Cargo.toml
@@ -0,0 +1,19 @@
+[package]
+edition = "2024"
+name = "graphql_entity_mutation"
+publish = false
+version = "0.1.0"
+
+[dependencies]
+async-graphql = { workspace = true }
+cowlike = { path = "../cowlike" }
+entity_mutation = { path = "../entity_mutation" }
+graphql_common = { path = "../graphql_common" }
+graphql_permission = { path = "../graphql_permission" }
+model-entity = { path = "../model-entity" }
+models_permissions = { path = "../models_permissions" }
+workspace-hack = { version = "0.1", path = "../workspace-hack" }
+
+[dev-dependencies]
+macro_user_id = { path = "../macro_user_id" }
+tokio = { workspace = true }
diff --git a/crates/graphql_entity_mutation/src/lib.rs b/crates/graphql_entity_mutation/src/lib.rs
new file mode 100644
index 0000000000..396ec24fbb
--- /dev/null
+++ b/crates/graphql_entity_mutation/src/lib.rs
@@ -0,0 +1,15 @@
+//! GraphQL inbound adapter for capability-oriented mutations shared across
+//! canonical entity types.
+#![deny(missing_docs)]
+#![deny(clippy::missing_docs_in_private_items)]
+
+/// Capability-oriented entity mutation inputs, outputs, and resolvers.
+mod mutations;
+
+pub use mutations::{
+ ChannelSharePolicyInput, DuplicateEntityInput, EntityMutationPayload, EntityMutationRoot,
+ EntityRefInput, EntitySharePolicyInput, GraphqlEntityMutationError,
+ GraphqlEntityMutationErrorCode, GraphqlEntityMutationRef, GraphqlEntityMutationResult,
+ GraphqlMutationError, GraphqlMutationSuccess, GraphqlSharePolicyOperation, MoveEntityInput,
+ RenameEntityInput, UpdateEntitySharePolicyInput,
+};
diff --git a/crates/graphql_entity_mutation/src/mutations.rs b/crates/graphql_entity_mutation/src/mutations.rs
new file mode 100644
index 0000000000..ed6598b646
--- /dev/null
+++ b/crates/graphql_entity_mutation/src/mutations.rs
@@ -0,0 +1,639 @@
+use std::{borrow::Cow, collections::HashSet, marker::PhantomData, sync::Arc};
+
+use async_graphql::{Context, Enum, ErrorExtensions, ID, InputObject, Object, SimpleObject, Union};
+use cowlike::CowLike;
+use entity_mutation::{
+ DuplicateEntityRequest, EntityMutationActor, EntityMutationErrorCode, EntityMutationService,
+ EntityMutationSuccess, MoveEntityRequest, MutateEntitiesResult, RenameEntityRequest,
+ UpdateEntitySharePolicyRequest,
+};
+use graphql_common::{GraphqlEntity, GraphqlEntityType};
+use graphql_permission::GraphqlEntityAccessLevel;
+use model_entity::Entity;
+use models_permissions::share_permission::{
+ UpdateSharePermissionRequestV2,
+ channel_share_permission::{UpdateChannelSharePermission, UpdateOperation},
+};
+
+#[cfg(test)]
+mod test;
+
+/// Maximum number of independent entities accepted by a standard batch mutation.
+const MAX_ENTITY_MUTATION_BATCH: usize = 100;
+
+/// Build a GraphQL input error with the stable client-visible error code.
+fn invalid_request(message: impl Into<String>) -> async_graphql::Error {
+ async_graphql::Error::new(message.into()).extend_with(|_, extensions| {
+ extensions.set("code", "INVALID_INPUT");
+ })
+}
+
+/// Validate a standard mutation batch for size and duplicate entity references.
+fn validate_batch(
+ operation: &str,
+ refs: impl IntoIterator<Item = (GraphqlEntityType, String)>,
+) -> async_graphql::Result<()> {
+ validate_batch_with_limit(operation, refs, MAX_ENTITY_MUTATION_BATCH)
+}
+
+/// Validate a mutation batch using a capability-specific size limit.
+fn validate_batch_with_limit(
+ operation: &str,
+ refs: impl IntoIterator<Item = (GraphqlEntityType, String)>,
+ max_entities: usize,
+) -> async_graphql::Result<()> {
+ let refs = refs.into_iter().collect::<Vec<_>>();
+ if refs.len() > max_entities {
+ return Err(invalid_request(format!(
+ "{operation} accepts at most {max_entities} entities"
+ )));
+ }
+
+ let mut seen = HashSet::with_capacity(refs.len());
+ if let Some((entity_type, entity_id)) = refs.into_iter().find(|key| !seen.insert(key.clone())) {
+ let entity_type = entity_type.into_model();
+ return Err(invalid_request(format!(
+ "{operation} contains duplicate entity {entity_type}:{entity_id}"
+ )));
+ }
+ Ok(())
+}
+
+/// Convert a GraphQL entity reference into its duplicate-detection key.
+fn entity_input_key(entity: &EntityRefInput) -> (GraphqlEntityType, String) {
+ (entity.entity_type, entity.id.0.clone())
+}
+
+/// Root GraphQL mutation object for capability-oriented entity mutations.
+pub struct EntityMutationRoot<S> {
+ /// Associates the GraphQL adapter with its domain service.
+ _service: PhantomData<fn() -> S>,
+}
+
+impl<S> EntityMutationRoot<S> {
+ /// Construct the entity mutation root.
+ pub fn new() -> Self {
+ Self {
+ _service: PhantomData,
+ }
+ }
+}
+
+impl<S> Default for EntityMutationRoot<S> {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+/// Canonical entity reference accepted by unified mutations.
+#[derive(Clone, InputObject)]
+pub struct EntityRefInput {
+ /// Entity kind.
+ #[graphql(name = "type")]
+ pub entity_type: GraphqlEntityType,
+ /// Entity identifier in that kind's canonical namespace.
+ pub id: ID,
+}
+
+impl EntityRefInput {
+ /// Convert this GraphQL reference into the canonical entity model.
+ pub fn into_model(self) -> Entity<'static> {
+ self.entity_type.into_model().with_entity_string(self.id.0)
+ }
+}
+
+/// One entity rename in a batch.
+#[derive(InputObject)]
+pub struct RenameEntityInput {
+ /// Entity to rename.
+ pub entity: EntityRefInput,
+ /// New user-visible display name.
+ pub display_name: String,
+}
+
+impl RenameEntityInput {
+ /// Convert this GraphQL input into a domain rename request.
+ pub fn into_model(self) -> RenameEntityRequest {
+ RenameEntityRequest {
+ entity: self.entity.into_model(),
+ display_name: self.display_name,
+ }
+ }
+}
+
+/// One entity move in a batch.
+#[derive(InputObject)]
+pub struct MoveEntityInput {
+ /// Entity to move.
+ pub entity: EntityRefInput,
+ /// Destination project id. Omit or pass null to move to the root.
+ pub project_id: Option<ID>,
+}
+
+impl MoveEntityInput {
+ /// Convert this GraphQL input into a domain move request.
+ pub fn into_model(self) -> MoveEntityRequest {
+ MoveEntityRequest {
+ entity: self.entity.into_model(),
+ project_id: self.project_id.map(|id| id.0),
+ }
+ }
+}
+
+/// One entity duplication in a batch.
+#[derive(InputObject)]
+pub struct DuplicateEntityInput {
+ /// Source entity to duplicate.
+ pub entity: EntityRefInput,
+ /// Optional display name for the new entity.
+ pub display_name: Option<String>,
+}
+
+impl DuplicateEntityInput {
+ /// Convert this GraphQL input into a domain duplication request.
+ pub fn into_model(self) -> DuplicateEntityRequest {
+ DuplicateEntityRequest {
+ entity: self.entity.into_model(),
+ display_name: self.display_name,
+ }
+ }
+}
+
+/// Operation applied to one channel share-policy entry.
+#[derive(Clone, Copy, Enum, Eq, PartialEq)]
+pub enum GraphqlSharePolicyOperation {
+ /// Add an entry.
+ Add,
+ /// Remove an entry.
+ Remove,
+ /// Replace an existing entry.
+ Replace,
+}
+
+impl GraphqlSharePolicyOperation {
+ /// Convert this GraphQL operation into the permissions-domain model.
+ pub fn into_model(self) -> UpdateOperation {
+ match self {
+ Self::Add => UpdateOperation::Add,
+ Self::Remove => UpdateOperation::Remove,
+ Self::Replace => UpdateOperation::Replace,
+ }
+ }
+}
+
+/// Channel-specific entry inside the otherwise common share-policy model.
+#[derive(InputObject)]
+pub struct ChannelSharePolicyInput {
+ /// Requested change.
+ pub operation: GraphqlSharePolicyOperation,
+ /// Channel receiving or losing access.
+ pub channel_id: ID,
+ /// Access level for add/replace operations.
+ pub access_level: Option<GraphqlEntityAccessLevel>,
+}
+
+impl ChannelSharePolicyInput {
+ /// Convert this GraphQL input into a channel share-permission update.
+ pub fn into_model(self) -> UpdateChannelSharePermission {
+ UpdateChannelSharePermission {
+ operation: self.operation.into_model(),
+ channel_id: self.channel_id.0,
+ access_level: self.access_level.map(GraphqlEntityAccessLevel::into_model),
+ }
+ }
+}
+
+/// Shared public/channel share-policy update.
+#[derive(InputObject)]
+pub struct EntitySharePolicyInput {
+ /// Whether public access should be enabled.
+ pub is_public: Option<bool>,
+ /// Public access level when public access is enabled.
+ pub public_access_level: Option<GraphqlEntityAccessLevel>,
+ /// Channel access entries to add, remove, or replace.
+ pub channel_share_permissions: Option<Vec<ChannelSharePolicyInput>>,
+}
+
+impl EntitySharePolicyInput {
+ /// Convert this GraphQL input into a shared permission update.
+ pub fn into_model(self) -> UpdateSharePermissionRequestV2 {
+ UpdateSharePermissionRequestV2 {
+ is_public: self.is_public,
+ public_access_level: self
+ .public_access_level
+ .map(GraphqlEntityAccessLevel::into_model),
+ channel_share_permissions: self.channel_share_permissions.map(|entries| {
+ entries
+ .into_iter()
+ .map(ChannelSharePolicyInput::into_model)
+ .collect()
+ }),
+ }
+ }
+}
+
+/// One share-policy update in a batch.
+#[derive(InputObject)]
+pub struct UpdateEntitySharePolicyInput {
+ /// Entity whose share policy should change.
+ pub entity: EntityRefInput,
+ /// New public/channel policy values.
+ pub policy: EntitySharePolicyInput,
+}
+
+impl UpdateEntitySharePolicyInput {
+ /// Convert this GraphQL input into a domain share-policy request.
+ pub fn into_model(self) -> UpdateEntitySharePolicyRequest {
+ UpdateEntitySharePolicyRequest {
+ entity: self.entity.into_model(),
+ policy: self.policy.into_model(),
+ }
+ }
+}
+
+/// Validate conditional fields required by public and channel share updates.
+fn validate_share_policy_inputs(
+ inputs: &[UpdateEntitySharePolicyInput],
+) -> async_graphql::Result<()> {
+ for input in inputs {
+ if input.policy.is_public == Some(true) && input.policy.public_access_level.is_none() {
+ return Err(invalid_request(
+ "publicAccessLevel is required when public access is enabled",
+ ));
+ }
+ if let Some(entries) = &input.policy.channel_share_permissions {
+ for entry in entries {
+ if matches!(
+ entry.operation,
+ GraphqlSharePolicyOperation::Add | GraphqlSharePolicyOperation::Replace
+ ) && entry.access_level.is_none()
+ {
+ return Err(invalid_request(
+ "accessLevel is required for ADD and REPLACE channel share operations",
+ ));
+ }
+ }
+ }
+ }
+ Ok(())
+}
+
+/// Stable machine-readable mutation error code.
+#[derive(Clone, Copy, Enum, Eq, PartialEq)]
+pub enum GraphqlEntityMutationErrorCode {
+ /// Operation is unavailable for the requested entity kind.
+ UnsupportedOperation,
+ /// Input violates a domain constraint.
+ InvalidInput,
+ /// Actor lacks the required capability.
+ Forbidden,
+ /// Entity was not found.
+ NotFound,
+ /// Mutation conflicts with current state.
+ Conflict,
+ /// Internal failure.
+ Internal,
+}
+
+impl GraphqlEntityMutationErrorCode {
+ /// Construct a GraphQL error code from the entity-mutation domain model.
+ pub fn new(value: EntityMutationErrorCode) -> Self {
+ match value {
+ EntityMutationErrorCode::UnsupportedOperation(_) => Self::UnsupportedOperation,
+ EntityMutationErrorCode::InvalidInput(_) => Self::InvalidInput,
+ EntityMutationErrorCode::Forbidden(_) => Self::Forbidden,
+ EntityMutationErrorCode::NotFound(_) => Self::NotFound,
+ EntityMutationErrorCode::Conflict(_) => Self::Conflict,
+ EntityMutationErrorCode::Internal(_) => Self::Internal,
+ }
+ }
+}
+
+/// User-safe per-entity mutation error.
+#[derive(SimpleObject)]
+pub struct GraphqlEntityMutationError {
+ /// Machine-readable error category.
+ pub code: GraphqlEntityMutationErrorCode,
+ /// User-safe explanation.
+ pub message: String,
+}
+
+/// Embedded canonical entity reference returned by mutation payloads.
+///
+/// `entityId` is deliberately not named `id`: this object references another
+/// entity and must not itself become a normalized cache record.
+#[derive(Clone, SimpleObject)]
+pub struct GraphqlEntityMutationRef {
+ /// Entity kind.
+ #[graphql(name = "type")]
+ pub entity_type: GraphqlEntityType,
+ /// Canonical entity id.
+ pub entity_id: ID,
+}
+
+impl GraphqlEntityMutationRef {
+ /// Construct a GraphQL mutation reference from a canonical entity.
+ pub fn new(value: Entity<'static>) -> Self {
+ let entity_type = GraphqlEntityType::new(value.entity_type);
+ Self {
+ entity_type,
+ entity_id: ID(value.entity_id.into_owned()),
+ }
+ }
+}
+
+/// Successful result for one requested entity mutation.
+pub struct GraphqlMutationSuccess<'a>(
+ /// Canonical entities changed by the mutation.
+ Cow<'a, [Entity<'a>]>,
+);
+
+/// Successful result for one requested entity mutation.
+#[Object]
+impl<'a> GraphqlMutationSuccess<'a> {
+ /// Canonical references to every entity changed by the mutation.
+ async fn affected_entities(&self) -> Vec<GraphqlEntity<'_>> {
+ self.0
+ .iter()
+ .map(CowLike::copied)
+ .map(GraphqlEntity)
+ .collect()
+ }
+}
+
+/// User-safe failure for one requested entity mutation.
+pub struct GraphqlMutationError(
+ /// Stable domain error category for the failed mutation.
+ EntityMutationErrorCode,
+);
+
+/// User-safe failure for one requested entity mutation.
+#[Object]
+impl GraphqlMutationError {
+ /// Stable machine-readable error category.
+ async fn error_code(&self) -> GraphqlEntityMutationErrorCode {
+ GraphqlEntityMutationErrorCode::new(self.0)
+ }
+
+ /// User-safe explanation of the failure.
+ async fn message(&self) -> &'static str {
+ match self.0 {
+ EntityMutationErrorCode::UnsupportedOperation(_) => {
+ "Operation is not supported for this entity"
+ }
+ EntityMutationErrorCode::InvalidInput(_) => "invalid entity mutation input",
+ EntityMutationErrorCode::Forbidden(_) => "insufficient permission for entity mutation",
+ EntityMutationErrorCode::NotFound(_) => "entity could not be found",
+ EntityMutationErrorCode::Conflict(_) => {
+ "entity mutation conflicts with current entity state"
+ }
+ EntityMutationErrorCode::Internal(_) => "An internal error occurred",
+ }
+ }
+}
+
+/// Result for one requested entity in a batch.
+#[derive(Union)]
+pub enum GraphqlEntityMutationResult<'a> {
+ /// the request succeeded
+ ///
+ Success(GraphqlMutationSuccess<'a>),
+ /// the request failed
+ Error(GraphqlMutationError),
+}
+
+impl<'a> GraphqlEntityMutationResult<'a> {
+ /// Convert a borrowed domain mutation outcome into its GraphQL union variant.
+ fn new(x: Result<&'a EntityMutationSuccess<'a>, &'a EntityMutationErrorCode>) -> Self {
+ match x {
+ Ok(r) => GraphqlEntityMutationResult::Success(GraphqlMutationSuccess(Cow::Borrowed(
+ &r.affected_entities,
+ ))),
+ Err(e) => GraphqlEntityMutationResult::Error(GraphqlMutationError(*e)),
+ }
+ }
+}
+
+impl GraphqlEntityMutationResult<'static> {
+ /// Convert an owned domain mutation outcome into its GraphQL union variant.
+ fn new_static(x: Result<EntityMutationSuccess<'static>, EntityMutationErrorCode>) -> Self {
+ match x {
+ Ok(r) => GraphqlEntityMutationResult::Success(GraphqlMutationSuccess(Cow::Owned(
+ r.affected_entities,
+ ))),
+ Err(e) => GraphqlEntityMutationResult::Error(GraphqlMutationError(e)),
+ }
+ }
+}
+
+/// Batch mutation payload. Results preserve input order and allow partial
+/// success across independently stored entity kinds.
+pub struct EntityMutationPayload {
+ /// Per-input mutation outcomes.
+ results: Vec<MutateEntitiesResult<'static>>,
+}
+
+impl EntityMutationPayload {
+ /// Construct a batch payload from ordered domain mutation outcomes.
+ fn new(results: Vec<MutateEntitiesResult<'static>>) -> Self {
+ EntityMutationPayload { results }
+ }
+}
+
+/// Results for a batch mutation, preserving the input order.
+#[Object]
+impl EntityMutationPayload {
+ /// Per-input mutation outcomes.
+ async fn results<'a>(&'a self) -> Vec<GraphqlEntityMutationResult<'a>> {
+ self.results
+ .iter()
+ .map(Result::as_ref)
+ .map(GraphqlEntityMutationResult::new)
+ .collect()
+ }
+}
+
+/// Extract the domain mutation port installed in the request context.
+fn mutation_service<'ctx, S: EntityMutationService>(
+ ctx: &'ctx Context<'_>,
+) -> async_graphql::Result<&'ctx Arc<S>> {
+ ctx.data::<Arc<S>>()
+}
+
+/// Extract the authenticated actor installed in the request context.
+fn mutation_actor(ctx: &Context<'_>) -> async_graphql::Result<EntityMutationActor> {
+ Ok(ctx.data::<EntityMutationActor>()?.clone())
+}
+
+#[Object]
+impl<S: EntityMutationService> EntityMutationRoot<S> {
+ /// Rename heterogeneous entities in one request.
+ async fn rename_entities(
+ &self,
+ ctx: &Context<'_>,
+ inputs: Vec<RenameEntityInput>,
+ ) -> async_graphql::Result<EntityMutationPayload> {
+ validate_batch(
+ "renameEntities",
+ inputs.iter().map(|input| entity_input_key(&input.entity)),
+ )?;
+ Ok(EntityMutationPayload::new(
+ mutation_service::<S>(ctx)?
+ .rename_entities(
+ mutation_actor(ctx)?,
+ inputs
+ .into_iter()
+ .map(RenameEntityInput::into_model)
+ .collect(),
+ )
+ .await,
+ ))
+ }
+
+ /// Move heterogeneous entities to a project or to the root.
+ async fn move_entities(
+ &self,
+ ctx: &Context<'_>,
+ inputs: Vec<MoveEntityInput>,
+ ) -> async_graphql::Result<EntityMutationPayload> {
+ validate_batch(
+ "moveEntities",
+ inputs.iter().map(|input| entity_input_key(&input.entity)),
+ )?;
+ Ok(EntityMutationPayload::new(
+ mutation_service::<S>(ctx)?
+ .move_entities(
+ mutation_actor(ctx)?,
+ inputs
+ .into_iter()
+ .map(MoveEntityInput::into_model)
+ .collect(),
+ )
+ .await,
+ ))
+ }
+
+ /// Update public and channel share policies across supported entity kinds.
+ async fn update_entity_share_policies(
+ &self,
+ ctx: &Context<'_>,
+ inputs: Vec<UpdateEntitySharePolicyInput>,
+ ) -> async_graphql::Result<EntityMutationPayload> {
+ validate_batch(
+ "updateEntitySharePolicies",
+ inputs.iter().map(|input| entity_input_key(&input.entity)),
+ )?;
+ validate_share_policy_inputs(&inputs)?;
+ Ok(EntityMutationPayload::new(
+ mutation_service::<S>(ctx)?
+ .update_share_policies(
+ mutation_actor(ctx)?,
+ inputs
+ .into_iter()
+ .map(UpdateEntitySharePolicyInput::into_model)
+ .collect(),
+ )
+ .await,
+ ))
+ }
+
+ /// Soft-delete entities with a reversible trash lifecycle.
+ async fn trash_entities(
+ &self,
+ ctx: &Context<'_>,
+ entities: Vec<EntityRefInput>,
+ ) -> async_graphql::Result<EntityMutationPayload> {
+ validate_batch("trashEntities", entities.iter().map(entity_input_key))?;
+ Ok(EntityMutationPayload::new(
+ mutation_service::<S>(ctx)?
+ .trash_entities(
+ mutation_actor(ctx)?,
+ entities
+ .into_iter()
+ .map(EntityRefInput::into_model)
+ .collect(),
+ )
+ .await,
+ ))
+ }
+
+ /// Restore reversibly deleted entities.
+ async fn restore_entities(
+ &self,
+ ctx: &Context<'_>,
+ entities: Vec<EntityRefInput>,
+ ) -> async_graphql::Result<EntityMutationPayload> {
+ validate_batch("restoreEntities", entities.iter().map(entity_input_key))?;
+ Ok(EntityMutationPayload::new(
+ mutation_service::<S>(ctx)?
+ .restore_entities(
+ mutation_actor(ctx)?,
+ entities
+ .into_iter()
+ .map(EntityRefInput::into_model)
+ .collect(),
+ )
+ .await,
+ ))
+ }
+
+ /// Irreversibly delete entities.
+ async fn delete_entities_permanently(
+ &self,
+ ctx: &Context<'_>,
+ entities: Vec<EntityRefInput>,
+ ) -> async_graphql::Result<EntityMutationPayload> {
+ validate_batch(
+ "deleteEntitiesPermanently",
+ entities.iter().map(entity_input_key),
+ )?;
+ Ok(EntityMutationPayload::new(
+ mutation_service::<S>(ctx)?
+ .delete_entities_permanently(
+ mutation_actor(ctx)?,
+ entities
+ .into_iter()
+ .map(EntityRefInput::into_model)
+ .collect(),
+ )
+ .await,
+ ))
+ }
+
+ /// Duplicate supported entities.
+ async fn duplicate_entities(
+ &self,
+ ctx: &Context<'_>,
+ inputs: Vec<DuplicateEntityInput>,
+ ) -> async_graphql::Result<EntityMutationPayload> {
+ validate_batch(
+ "duplicateEntities",
+ inputs.iter().map(|input| entity_input_key(&input.entity)),
+ )?;
+ Ok(EntityMutationPayload::new(
+ mutation_service::<S>(ctx)?
+ .duplicate_entities(
+ mutation_actor(ctx)?,
+ inputs
+ .into_iter()
+ .map(DuplicateEntityInput::into_model)
+ .collect(),
+ )
+ .await,
+ ))
+ }
+
+ /// Add or remove an entity from the actor's favorites.
+ async fn set_entity_favorite(
+ &self,
+ ctx: &Context<'_>,
+ entity: EntityRefInput,
+ favorite: bool,
+ ) -> async_graphql::Result<GraphqlEntityMutationResult<'static>> {
+ let res = mutation_service::<S>(ctx)?
+ .set_favorite(mutation_actor(ctx)?, entity.into_model(), favorite)
+ .await;
+
+ Ok(GraphqlEntityMutationResult::new_static(res))
+ }
+}
diff --git a/crates/graphql_entity_mutation/src/mutations/test.rs b/crates/graphql_entity_mutation/src/mutations/test.rs
new file mode 100644
index 0000000000..6bb3b4b225
--- /dev/null
+++ b/crates/graphql_entity_mutation/src/mutations/test.rs
@@ -0,0 +1,120 @@
+use std::sync::Arc;
+
+use async_graphql::{EmptySubscription, Object, Request, Schema, value};
+use entity_mutation::{EntityMutationActor, UnavailableEntityMutationService};
+use macro_user_id::user_id::MacroUserIdStr;
+
+/// Minimal query root used to exercise the mutation module in isolation.
+struct QueryRoot;
+
+#[Object]
+impl QueryRoot {
+ /// Return a trivial value so the test schema has a valid query root.
+ async fn health(&self) -> bool {
+ true
+ }
+}
+
+#[tokio::test]
+async fn mutation_results_return_typed_errors() {
+ let service = Arc::new(UnavailableEntityMutationService);
+ let actor = EntityMutationActor {
+ user_id: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),
+ organization_id: Some(42),
+ };
+ let request = Request::new(
+ r#"
+ mutation {
+ renameEntities(
+ inputs: [{
+ entity: { type: DOCUMENT, id: "document-1" }
+ displayName: "Renamed"
+ }]
+ ) {
+ results {
+ __typename
+ ... on GraphqlMutationSuccess {
+ affectedEntities { id entityType }
+ }
+ ... on GraphqlMutationError {
+ errorCode
+ message
+ }
+ }
+ }
+ }
+ "#,
+ )
+ .data(service)
+ .data(actor);
+
+ let response = Schema::build(
+ QueryRoot,
+ crate::EntityMutationRoot::<UnavailableEntityMutationService>::new(),
+ EmptySubscription,
+ )
+ .finish()
+ .execute(request)
+ .await;
+
+ assert!(response.errors.is_empty(), "{:?}", response.errors);
+ assert_eq!(
+ response.data,
+ value!({
+ "renameEntities": {
+ "results": [{
+ "__typename": "GraphqlMutationError",
+ "errorCode": "UNSUPPORTED_OPERATION",
+ "message": "Operation is not supported for this entity",
+ }],
+ },
+ })
+ );
+}
+
+#[test]
+fn batch_validation_rejects_oversized_and_duplicate_requests() {
+ let oversized = (0..=super::MAX_ENTITY_MUTATION_BATCH).map(|index| {
+ (
+ graphql_common::GraphqlEntityType::Document,
+ format!("document-{index}"),
+ )
+ });
+ let error = super::validate_batch("renameEntities", oversized).unwrap_err();
+ assert!(error.message.contains("accepts at most"));
+
+ let duplicate = [
+ (
+ graphql_common::GraphqlEntityType::Document,
+ "document-1".to_owned(),
+ ),
+ (
+ graphql_common::GraphqlEntityType::Document,
+ "document-1".to_owned(),
+ ),
+ ];
+ let error = super::validate_batch("renameEntities", duplicate).unwrap_err();
+ assert!(error.message.contains("duplicate entity"));
+}
+
+#[test]
+fn share_policy_validation_requires_access_levels_for_grants() {
+ let inputs = [super::UpdateEntitySharePolicyInput {
+ entity: super::EntityRefInput {
+ entity_type: graphql_common::GraphqlEntityType::Document,
+ id: "document-1".into(),
+ },
+ policy: super::EntitySharePolicyInput {
+ is_public: None,
+ public_access_level: None,
+ channel_share_permissions: Some(vec![super::ChannelSharePolicyInput {
+ operation: super::GraphqlSharePolicyOperation::Add,
+ channel_id: "channel-1".into(),
+ access_level: None,
+ }]),
+ },
+ }];
+
+ let error = super::validate_share_policy_inputs(&inputs).unwrap_err();
+ assert!(error.message.contains("accessLevel is required"));
+}
diff --git a/crates/graphql_favorite/Cargo.toml b/crates/graphql_favorite/Cargo.toml
new file mode 100644
index 0000000000..7712b0617d
--- /dev/null
+++ b/crates/graphql_favorite/Cargo.toml
@@ -0,0 +1,17 @@
+[package]
+name = "graphql_favorite"
+version = "0.1.0"
+edition = "2024"
+publish = false
+
+[dependencies]
+async-graphql = { workspace = true, features = ["dataloader"] }
+favorites = { path = "../favorites", default-features = false, features = [
+ "ports",
+] }
+macro_user_id = { path = "../macro_user_id" }
+model-entity = { path = "../model-entity" }
+rootcause = { workspace = true }
+tokio = { workspace = true }
+tracing = { workspace = true }
+workspace-hack = { version = "0.1", path = "../workspace-hack" }
diff --git a/crates/graphql_favorite/src/favorite.rs b/crates/graphql_favorite/src/favorite.rs
new file mode 100644
index 0000000000..9953aeceb0
--- /dev/null
+++ b/crates/graphql_favorite/src/favorite.rs
@@ -0,0 +1,131 @@
+use std::{collections::HashMap, sync::Arc};
+
+use async_graphql::{Context, dataloader::DataLoader};
+use favorites::domain::ports::FavoritesService;
+use macro_user_id::user_id::MacroUserIdStr;
+use model_entity::{Entity, OwnedEntity};
+use rootcause::markers::{Cloneable, Dynamic};
+
+#[cfg(test)]
+mod test;
+
+/// Favorites reader used by GraphQL entity edges.
+pub trait EntityFavoriteEdgeReader: Send + Sync + 'static {
+ /// Resolve favorite state for the requested entities.
+ fn get_entity_favorites<'a>(
+ &'a self,
+ user_id: &'a MacroUserIdStr<'static>,
+ entities: Vec<Entity<'static>>,
+ ) -> impl Future<Output = Result<HashMap<Entity<'static>, bool>, rootcause::Report>> + Send + 'a;
+}
+
+impl<T> EntityFavoriteEdgeReader for Arc<T>
+where
+ T: FavoritesService,
+{
+ async fn get_entity_favorites(
+ &self,
+ user_id: &MacroUserIdStr<'static>,
+ entities: Vec<Entity<'static>>,
+ ) -> Result<HashMap<Entity<'static>, bool>, rootcause::Report> {
+ let favorites = self
+ .favorited_entities(user_id, &entities)
+ .await
+ .map_err(|error| rootcause::report!(error))?;
+
+ Ok(entities
+ .into_iter()
+ .map(|entity| {
+ let is_favorited = favorites.contains(&entity);
+ (entity, is_favorited)
+ })
+ .collect())
+ }
+}
+
+/// Favorites reader used by schema-only GraphQL construction.
+#[derive(Clone, Copy, Debug, Default)]
+pub struct NoOpEntityFavoriteEdgeReader;
+
+impl EntityFavoriteEdgeReader for NoOpEntityFavoriteEdgeReader {
+ async fn get_entity_favorites(
+ &self,
+ _user_id: &MacroUserIdStr<'static>,
+ entities: Vec<Entity<'static>>,
+ ) -> Result<HashMap<Entity<'static>, bool>, rootcause::Report> {
+ Ok(entities.into_iter().map(|entity| (entity, false)).collect())
+ }
+}
+
+/// Request-scoped DataLoader for current-viewer favorite state.
+pub struct EntityFavoriteLoader<R> {
+ /// Authenticated viewer whose favorite state is requested.
+ user_id: MacroUserIdStr<'static>,
+ /// Domain-facing reader that resolves favorite state.
+ reader: R,
+}
+
+impl<R> EntityFavoriteLoader<R> {
+ /// Construct a favorite loader for one authenticated viewer.
+ pub fn new(user_id: MacroUserIdStr<'static>, reader: R) -> Self {
+ Self { user_id, reader }
+ }
+}
+
+impl<R> async_graphql::dataloader::Loader<OwnedEntity> for EntityFavoriteLoader<R>
+where
+ R: EntityFavoriteEdgeReader,
+{
+ type Value = bool;
+ type Error = rootcause::Report<Dynamic, Cloneable>;
+
+ async fn load(
+ &self,
+ keys: &[OwnedEntity],
+ ) -> Result<HashMap<OwnedEntity, Self::Value>, Self::Error> {
+ let entities = keys.iter().map(|key| key.as_entity().clone()).collect();
+ match self
+ .reader
+ .get_entity_favorites(&self.user_id, entities)
+ .await
+ {
+ Ok(favorites) => Ok(favorites
+ .into_iter()
+ .map(|(entity, is_favorited)| (OwnedEntity::from(entity), is_favorited))
+ .collect()),
+ Err(error) => {
+ // Favorite state is an optional presentation edge. Preserve the
+ // REST Soup contract: a favorites outage must not make the
+ // underlying entities unavailable.
+ tracing::error!(error = ?error, "failed to resolve GraphQL entity favorites");
+ Ok(keys.iter().cloned().map(|key| (key, false)).collect())
+ }
+ }
+ }
+}
+
+/// Build a favorite DataLoader scoped to the authenticated viewer.
+pub fn entity_favorite_loader<R>(
+ user_id: MacroUserIdStr<'static>,
+ reader: R,
+) -> DataLoader<EntityFavoriteLoader<R>>
+where
+ R: EntityFavoriteEdgeReader,
+{
+ DataLoader::new(EntityFavoriteLoader::new(user_id, reader), tokio::spawn)
+}
+
+/// Resolve favorite state from GraphQL request data.
+pub async fn load_entity_favorite<R>(
+ ctx: &Context<'_>,
+ entity: Entity<'static>,
+) -> async_graphql::Result<bool>
+where
+ R: EntityFavoriteEdgeReader,
+{
+ let loader = ctx.data::<DataLoader<EntityFavoriteLoader<R>>>()?;
+ Ok(loader
+ .load_one(OwnedEntity::from(entity))
+ .await?
+ .unwrap_or(false))
+}
diff --git a/crates/graphql_favorite/src/favorite/test.rs b/crates/graphql_favorite/src/favorite/test.rs
new file mode 100644
index 0000000000..acfd0018fa
--- /dev/null
+++ b/crates/graphql_favorite/src/favorite/test.rs
@@ -0,0 +1,29 @@
+use super::*;
+use async_graphql::dataloader::Loader;
+use model_entity::EntityType;
+
+struct FailingFavoriteReader;
+
+impl EntityFavoriteEdgeReader for FailingFavoriteReader {
+ async fn get_entity_favorites(
+ &self,
+ _user_id: &MacroUserIdStr<'static>,
+ _entities: Vec<Entity<'static>>,
+ ) -> Result<HashMap<Entity<'static>, bool>, rootcause::Report> {
+ Err(rootcause::report!("favorites unavailable"))
+ }
+}
+
+#[tokio::test]
+async fn favorite_loader_fails_soft_when_reader_is_unavailable() {
+ let entity = EntityType::Document.with_entity_string("document-1".to_owned());
+ let key = OwnedEntity::from(entity);
+ let loader = EntityFavoriteLoader::new(
+ MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),
+ FailingFavoriteReader,
+ );
+
+ let result = loader.load(std::slice::from_ref(&key)).await.unwrap();
+
+ assert_eq!(result.get(&key), Some(&false));
+}
diff --git a/crates/graphql_favorite/src/lib.rs b/crates/graphql_favorite/src/lib.rs
new file mode 100644
index 0000000000..5e5a1d5da8
--- /dev/null
+++ b/crates/graphql_favorite/src/lib.rs
@@ -0,0 +1,12 @@
+//! GraphQL inbound adapter for the favorites domain: the DataLoader-backed
+//! current-viewer favorite edge attached to Soup entities.
+#![deny(missing_docs)]
+#![deny(clippy::missing_docs_in_private_items)]
+
+/// Lazy favorite-state edge loading.
+mod favorite;
+
+pub use favorite::{
+ EntityFavoriteEdgeReader, EntityFavoriteLoader, NoOpEntityFavoriteEdgeReader,
+ entity_favorite_loader, load_entity_favorite,
+};
diff --git a/crates/graphql_notification/src/objects.rs b/crates/graphql_notification/src/objects.rs
index e5787d2d45..24aa7d92c6 100644
--- a/crates/graphql_notification/src/objects.rs
+++ b/crates/graphql_notification/src/objects.rs
@@ -23,7 +23,7 @@ impl GraphqlSoupNotification {
/// The type of the associated entity.
async fn entity_type(&self) -> GraphqlSoupEntityType {
- GraphqlSoupEntityType::from(self.0.entity.entity_type)
+ GraphqlSoupEntityType::new(self.0.entity.entity_type)
}
/// The identifier of the associated entity.
diff --git a/crates/graphql_permission/Cargo.toml b/crates/graphql_permission/Cargo.toml
new file mode 100644
index 0000000000..09f918df21
--- /dev/null
+++ b/crates/graphql_permission/Cargo.toml
@@ -0,0 +1,17 @@
+[package]
+name = "graphql_permission"
+version = "0.1.0"
+edition = "2024"
+publish = false
+
+[dependencies]
+async-graphql = { workspace = true, features = ["dataloader"] }
+entity_access = { path = "../entity_access", default-features = false, features = [
+ "ports",
+] }
+futures = { workspace = true }
+macro_user_id = { path = "../macro_user_id" }
+model-entity = { path = "../model-entity" }
+rootcause = { workspace = true }
+tokio = { workspace = true }
+workspace-hack = { version = "0.1", path = "../workspace-hack" }
diff --git a/crates/graphql_permission/src/lib.rs b/crates/graphql_permission/src/lib.rs
new file mode 100644
index 0000000000..966a9f5180
--- /dev/null
+++ b/crates/graphql_permission/src/lib.rs
@@ -0,0 +1,15 @@
+//! GraphQL inbound adapter for the entity-access domain: current-viewer
+//! permission schema types and the DataLoader-backed permission edge
+//! attached to Soup entities.
+#![deny(missing_docs)]
+#![deny(clippy::missing_docs_in_private_items)]
+
+/// Lazy entity-permission edge loading and schema types.
+mod permission;
+
+pub use permission::{
+ EntityPermissionEdgeReader, EntityPermissionLoader, GraphqlAccessLevelPermission,
+ GraphqlChannelParticipantRole, GraphqlChannelRolePermission, GraphqlChannelViewOnlyPermission,
+ GraphqlEntityAccessLevel, GraphqlEntityPermission, GraphqlTeamRole, GraphqlTeamRolePermission,
+ NoOpEntityPermissionEdgeReader, entity_permission_loader, load_entity_permission,
+};
diff --git a/crates/graphql_permission/src/permission.rs b/crates/graphql_permission/src/permission.rs
new file mode 100644
index 0000000000..cb03f1e063
--- /dev/null
+++ b/crates/graphql_permission/src/permission.rs
@@ -0,0 +1,317 @@
+use std::{collections::HashMap, sync::Arc};
+
+use async_graphql::{Context, Enum, SimpleObject, Union, dataloader::DataLoader};
+use entity_access::domain::{
+ models::{AccessError, AccessLevel, EntityPermission, ParticipantRole, TeamRole},
+ ports::EntityAccessService,
+};
+use futures::{StreamExt, stream};
+use macro_user_id::user_id::MacroUserIdStr;
+use model_entity::{Entity, OwnedEntity};
+use rootcause::markers::{Cloneable, Dynamic};
+
+/// Item access level resolved for the current viewer.
+#[derive(Enum, Clone, Copy, PartialEq, Eq)]
+pub enum GraphqlEntityAccessLevel {
+ /// Read-only access.
+ View,
+ /// Comment access.
+ Comment,
+ /// Edit access.
+ Edit,
+ /// Owner access.
+ Owner,
+}
+
+impl GraphqlEntityAccessLevel {
+ /// Construct a GraphQL access level from the entity-access model.
+ pub fn new(value: AccessLevel) -> Self {
+ match value {
+ AccessLevel::View => Self::View,
+ AccessLevel::Comment => Self::Comment,
+ AccessLevel::Edit => Self::Edit,
+ AccessLevel::Owner => Self::Owner,
+ }
+ }
+
+ /// Convert this GraphQL access level into the entity-access model.
+ pub fn into_model(self) -> AccessLevel {
+ match self {
+ Self::View => AccessLevel::View,
+ Self::Comment => AccessLevel::Comment,
+ Self::Edit => AccessLevel::Edit,
+ Self::Owner => AccessLevel::Owner,
+ }
+ }
+}
+
+/// Channel role resolved for the current viewer.
+#[derive(Enum, Clone, Copy, PartialEq, Eq)]
+pub enum GraphqlChannelParticipantRole {
+ /// Channel owner.
+ Owner,
+ /// Channel administrator.
+ Admin,
+ /// Channel member.
+ Member,
+}
+
+impl GraphqlChannelParticipantRole {
+ /// Construct a GraphQL channel role from the entity-access model.
+ pub fn new(value: ParticipantRole) -> Self {
+ match value {
+ ParticipantRole::Owner => Self::Owner,
+ ParticipantRole::Admin => Self::Admin,
+ ParticipantRole::Member => Self::Member,
+ }
+ }
+}
+
+/// Team role resolved for the current viewer.
+#[derive(Enum, Clone, Copy, PartialEq, Eq)]
+pub enum GraphqlTeamRole {
+ /// Team owner.
+ Owner,
+ /// Team administrator.
+ Admin,
+ /// Team member.
+ Member,
+}
+
+impl GraphqlTeamRole {
+ /// Construct a GraphQL team role from the entity-access model.
+ pub fn new(value: TeamRole) -> Self {
+ match value {
+ TeamRole::Owner => Self::Owner,
+ TeamRole::Admin => Self::Admin,
+ TeamRole::Member => Self::Member,
+ }
+ }
+}
+
+/// Item-style permission represented by the viewer's effective access level.
+#[derive(SimpleObject)]
+pub struct GraphqlAccessLevelPermission {
+ /// Effective access level held by the viewer.
+ access_level: GraphqlEntityAccessLevel,
+}
+
+/// View-only channel permission without participant membership.
+#[derive(SimpleObject)]
+pub struct GraphqlChannelViewOnlyPermission {
+ /// Whether the viewer is limited to view-only channel access.
+ is_view_only: bool,
+}
+
+/// Channel permission represented by the viewer's participant role.
+#[derive(SimpleObject)]
+pub struct GraphqlChannelRolePermission {
+ /// Channel participant role held by the viewer.
+ role: GraphqlChannelParticipantRole,
+}
+
+/// Team permission represented by the viewer's membership role.
+#[derive(SimpleObject)]
+pub struct GraphqlTeamRolePermission {
+ /// Team membership role held by the viewer.
+ role: GraphqlTeamRole,
+}
+
+/// Permission held by the current viewer for an entity.
+///
+/// The concrete union member identifies whether access comes from an item
+/// access level, view-only channel access, a channel role, or a team role.
+#[derive(Union)]
+pub enum GraphqlEntityPermission {
+ /// Permission for item-based entities (document, chat, project, thread).
+ AccessLevel(GraphqlAccessLevelPermission),
+ /// View-only permission for a channel without an active participant role.
+ ChannelViewOnly(GraphqlChannelViewOnlyPermission),
+ /// Permission for channel-based entities with an active participant role.
+ ChannelRole(GraphqlChannelRolePermission),
+ /// Permission for team-based entities.
+ TeamRole(GraphqlTeamRolePermission),
+}
+
+impl GraphqlEntityPermission {
+ /// Convert a domain permission into its concrete GraphQL union member.
+ fn new(permission: EntityPermission) -> Self {
+ match permission {
+ EntityPermission::AccessLevel { access_level } => {
+ Self::AccessLevel(GraphqlAccessLevelPermission {
+ access_level: GraphqlEntityAccessLevel::new(access_level),
+ })
+ }
+ EntityPermission::ChannelViewOnly => {
+ Self::ChannelViewOnly(GraphqlChannelViewOnlyPermission { is_view_only: true })
+ }
+ EntityPermission::ChannelRole { role } => {
+ Self::ChannelRole(GraphqlChannelRolePermission {
+ role: GraphqlChannelParticipantRole::new(role),
+ })
+ }
+ EntityPermission::TeamRole { role } => Self::TeamRole(GraphqlTeamRolePermission {
+ role: GraphqlTeamRole::new(role),
+ }),
+ }
+ }
+}
+
+/// Permission reader used by GraphQL entity edges.
+pub trait EntityPermissionEdgeReader: Send + Sync + 'static {
+ /// Resolve permissions for the requested entities. Missing or inaccessible
+ /// entities map to `None` instead of leaking their existence.
+ fn get_entity_permissions<'a>(
+ &'a self,
+ user_id: &'a MacroUserIdStr<'static>,
+ organization_id: Option<i64>,
+ entities: Vec<Entity<'static>>,
+ ) -> impl Future<
+ Output = Result<HashMap<Entity<'static>, Option<EntityPermission>>, rootcause::Report>,
+ > + Send
+ + 'a;
+}
+
+impl<T> EntityPermissionEdgeReader for Arc<T>
+where
+ T: EntityAccessService,
+{
+ async fn get_entity_permissions(
+ &self,
+ user_id: &MacroUserIdStr<'static>,
+ organization_id: Option<i64>,
+ entities: Vec<Entity<'static>>,
+ ) -> Result<HashMap<Entity<'static>, Option<EntityPermission>>, rootcause::Report> {
+ let mut futures = Vec::with_capacity(entities.len());
+ for entity in entities {
+ futures.push(async move {
+ let permission = self
+ .get_entity_permission(
+ Some(user_id),
+ &entity.entity_id,
+ entity.entity_type,
+ organization_id,
+ )
+ .await;
+ (entity, permission)
+ });
+ }
+ let permissions = stream::iter(futures)
+ // A Soup page can contain many heterogeneous entities. Keep the edge
+ // lazy and parallel, but do not let one request consume the whole DB
+ // pool while the entity-access port has no bulk lookup yet.
+ .buffer_unordered(16)
+ .collect::<Vec<_>>()
+ .await;
+
+ let mut result = HashMap::with_capacity(permissions.len());
+ for (entity, permission) in permissions {
+ match permission {
+ Ok(permission) => {
+ result.insert(entity, Some(permission));
+ }
+ Err(
+ AccessError::Unauthorized
+ | AccessError::UnauthorizedWithMessage(_)
+ | AccessError::NotFound(_),
+ ) => {
+ result.insert(entity, None);
+ }
+ Err(error) => return Err(rootcause::report!(error).into()),
+ }
+ }
+ Ok(result)
+ }
+}
+
+/// Permission reader used by schema-only GraphQL construction.
+#[derive(Clone, Copy, Debug, Default)]
+pub struct NoOpEntityPermissionEdgeReader;
+
+impl EntityPermissionEdgeReader for NoOpEntityPermissionEdgeReader {
+ async fn get_entity_permissions(
+ &self,
+ _user_id: &MacroUserIdStr<'static>,
+ _organization_id: Option<i64>,
+ entities: Vec<Entity<'static>>,
+ ) -> Result<HashMap<Entity<'static>, Option<EntityPermission>>, rootcause::Report> {
+ Ok(entities.into_iter().map(|entity| (entity, None)).collect())
+ }
+}
+
+/// Request-scoped DataLoader for current-viewer entity permissions.
+pub struct EntityPermissionLoader<R> {
+ /// Authenticated viewer whose permissions are requested.
+ user_id: MacroUserIdStr<'static>,
+ /// Organization context used when resolving permissions.
+ organization_id: Option<i64>,
+ /// Domain-facing reader that resolves effective access.
+ reader: R,
+}
+
+impl<R> EntityPermissionLoader<R> {
+ /// Construct a permission loader for one authenticated viewer.
+ pub fn new(user_id: MacroUserIdStr<'static>, organization_id: Option<i64>, reader: R) -> Self {
+ Self {
+ user_id,
+ organization_id,
+ reader,
+ }
+ }
+}
+
+impl<R> async_graphql::dataloader::Loader<OwnedEntity> for EntityPermissionLoader<R>
+where
+ R: EntityPermissionEdgeReader,
+{
+ type Value = Option<EntityPermission>;
+ type Error = rootcause::Report<Dynamic, Cloneable>;
+
+ async fn load(
+ &self,
+ keys: &[OwnedEntity],
+ ) -> Result<HashMap<OwnedEntity, Self::Value>, Self::Error> {
+ let entities = keys.iter().map(|key| key.as_entity().clone()).collect();
+ self.reader
+ .get_entity_permissions(&self.user_id, self.organization_id, entities)
+ .await
+ .map(|permissions| {
+ permissions
+ .into_iter()
+ .map(|(entity, permission)| (OwnedEntity::from(entity), permission))
+ .collect()
+ })
+ .map_err(|error| error.into_cloneable())
+ }
+}
+
+/// Build a permission DataLoader scoped to the authenticated viewer.
+pub fn entity_permission_loader<R>(
+ user_id: MacroUserIdStr<'static>,
+ organization_id: Option<i64>,
+ reader: R,
+) -> DataLoader<EntityPermissionLoader<R>>
+where
+ R: EntityPermissionEdgeReader,
+{
+ DataLoader::new(
+ EntityPermissionLoader::new(user_id, organization_id, reader),
+ tokio::spawn,
+ )
+}
+
+/// Resolve a typed current-viewer permission from GraphQL request data.
+pub async fn load_entity_permission<R>(
+ ctx: &Context<'_>,
+ entity: Entity<'static>,
+) -> async_graphql::Result<Option<GraphqlEntityPermission>>
+where
+ R: EntityPermissionEdgeReader,
+{
+ let loader = ctx.data::<DataLoader<EntityPermissionLoader<R>>>()?;
+ Ok(loader
+ .load_one(OwnedEntity::from(entity))
+ .await?
+ .flatten()
+ .map(GraphqlEntityPermission::new))
+}
diff --git a/crates/graphql_properties/src/mutations.rs b/crates/graphql_properties/src/mutations.rs
index 3e615c3fce..5006ccc354 100644
--- a/crates/graphql_properties/src/mutations.rs
+++ b/crates/graphql_properties/src/mutations.rs
@@ -127,17 +127,18 @@ pub enum GraphqlPropertyTargetEntityType {
User,
}
-impl From<GraphqlPropertyTargetEntityType> for model_entity::EntityType {
- fn from(value: GraphqlPropertyTargetEntityType) -> Self {
- match value {
- GraphqlPropertyTargetEntityType::CallRecord => Self::Call,
- GraphqlPropertyTargetEntityType::Channel => Self::Channel,
- GraphqlPropertyTargetEntityType::Chat => Self::Chat,
- GraphqlPropertyTargetEntityType::Company => Self::CrmCompany,
- GraphqlPropertyTargetEntityType::Document => Self::Document,
- GraphqlPropertyTargetEntityType::Project => Self::Project,
- GraphqlPropertyTargetEntityType::Thread => Self::EmailThread,
- GraphqlPropertyTargetEntityType::User => Self::User,
+impl GraphqlPropertyTargetEntityType {
+ /// Convert this GraphQL target type into the canonical entity model.
+ pub fn into_model(self) -> model_entity::EntityType {
+ match self {
+ Self::CallRecord => model_entity::EntityType::Call,
+ Self::Channel => model_entity::EntityType::Channel,
+ Self::Chat => model_entity::EntityType::Chat,
+ Self::Company => model_entity::EntityType::CrmCompany,
+ Self::Document => model_entity::EntityType::Document,
+ Self::Project => model_entity::EntityType::Project,
+ Self::Thread => model_entity::EntityType::EmailThread,
+ Self::User => model_entity::EntityType::User,
}
}
}
@@ -170,7 +171,7 @@ impl GraphqlEntityReferenceInput {
/// Convert the GraphQL reference into its properties-domain model.
fn try_into_model(self) -> async_graphql::Result<EntityReference> {
Ok(EntityReference {
- entity_type: self.entity_type.into(),
+ entity_type: self.entity_type.into_model(),
entity_id: self.entity_id,
specific_message_id: self
.specific_message_id
@@ -267,7 +268,7 @@ where
let property = writer
.set_entity_property(
- input.entity_type.into(),
+ input.entity_type.into_model(),
input.entity_id,
property_definition_id,
value,
@@ -275,7 +276,7 @@ where
.await
.map_err(|err| async_graphql::Error::new(err.to_string()))?;
- Ok(property.into())
+ Ok(GraphqlProperty::new(property))
}
}
diff --git a/crates/graphql_properties/src/objects.rs b/crates/graphql_properties/src/objects.rs
index 576c69e28f..9c5d3188f5 100644
--- a/crates/graphql_properties/src/objects.rs
+++ b/crates/graphql_properties/src/objects.rs
@@ -29,8 +29,9 @@ pub enum GraphqlPropertyDataType {
Link,
}
-impl From<models_properties::DataType> for GraphqlPropertyDataType {
- fn from(data_type: models_properties::DataType) -> Self {
+impl GraphqlPropertyDataType {
+ /// Construct a GraphQL data type from the properties-domain model.
+ pub fn new(data_type: models_properties::DataType) -> Self {
match data_type {
models_properties::DataType::Boolean => Self::Boolean,
models_properties::DataType::Date => Self::Date,
@@ -59,14 +60,15 @@ where
.await
.map_err(|err| async_graphql::Error::new(err.to_string()))?
.unwrap_or_default();
- Ok(properties.into_iter().map(GraphqlProperty::from).collect())
+ Ok(properties.into_iter().map(GraphqlProperty::new).collect())
}
/// A property definition assigned to an entity, together with its current value.
pub struct GraphqlProperty(EntityPropertyWithDefinition);
-impl From<EntityPropertyWithDefinition> for GraphqlProperty {
- fn from(value: EntityPropertyWithDefinition) -> Self {
+impl GraphqlProperty {
+ /// Construct a GraphQL property from its properties-domain model.
+ pub fn new(value: EntityPropertyWithDefinition) -> Self {
Self(value)
}
}
@@ -91,7 +93,7 @@ impl GraphqlProperty {
/// The type of value accepted by the property.
async fn data_type(&self) -> GraphqlPropertyDataType {
- self.0.definition.data_type.into()
+ GraphqlPropertyDataType::new(self.0.definition.data_type)
}
/// Whether the property can contain more than one value.
@@ -104,7 +106,7 @@ impl GraphqlProperty {
self.0
.definition
.specific_entity_type
- .map(GraphqlPropertyEntityType::from)
+ .map(GraphqlPropertyEntityType::new)
}
/// Whether this property is managed by the system.
@@ -119,7 +121,7 @@ impl GraphqlProperty {
/// The current value, represented by exactly one typed union variant.
async fn value(&self) -> Option<GraphqlPropertyValue> {
- self.0.value.as_ref().map(GraphqlPropertyValue::from)
+ self.0.value.as_ref().map(GraphqlPropertyValue::new)
}
}
@@ -191,8 +193,9 @@ pub struct GraphqlLinkPropertyValue {
urls: Vec<String>,
}
-impl From<&PropertyValue> for GraphqlPropertyValue {
- fn from(value: &PropertyValue) -> Self {
+impl GraphqlPropertyValue {
+ /// Construct a GraphQL property value from its properties-domain model.
+ pub fn new(value: &PropertyValue) -> Self {
match value {
PropertyValue::Bool(value) => {
Self::Boolean(GraphqlBooleanPropertyValue { value: *value })
@@ -213,7 +216,7 @@ impl From<&PropertyValue> for GraphqlPropertyValue {
Self::EntityReference(GraphqlEntityReferencePropertyValue {
references: values
.iter()
- .map(GraphqlPropertyEntityReference::from)
+ .map(GraphqlPropertyEntityReference::new)
.collect(),
})
}
@@ -235,11 +238,12 @@ pub struct GraphqlPropertyEntityReference {
specific_message_id: Option<ID>,
}
-impl From<&models_properties::EntityReference> for GraphqlPropertyEntityReference {
- fn from(value: &models_properties::EntityReference) -> Self {
+impl GraphqlPropertyEntityReference {
+ /// Construct a GraphQL entity reference from its properties-domain model.
+ pub fn new(value: &models_properties::EntityReference) -> Self {
Self {
entity_id: value.entity_id.clone(),
- entity_type: value.entity_type.into(),
+ entity_type: GraphqlPropertyEntityType::new(value.entity_type),
specific_message_id: value
.specific_message_id
.map(|message_id| ID(message_id.to_string())),
diff --git a/crates/graphql_soup/Cargo.toml b/crates/graphql_soup/Cargo.toml
index 056d76310b..3faeb79be0 100644
--- a/crates/graphql_soup/Cargo.toml
+++ b/crates/graphql_soup/Cargo.toml
@@ -22,6 +22,7 @@ entity_access = { path = "../entity_access", default-features = false, features
] }
filter_ast = { path = "../filter_ast" }
graphql_common = { path = "../graphql_common" }
+graphql_permission = { path = "../graphql_permission" }
item_filters = { path = "../item_filters" }
macro_authorization = { path = "../macro_authorization", default-features = false, features = ["axum"] }
macro_user_id = { path = "../macro_user_id" }
diff --git a/crates/graphql_soup/src/inputs.rs b/crates/graphql_soup/src/inputs.rs
index 85ef5de053..2fd03ed083 100644
--- a/crates/graphql_soup/src/inputs.rs
+++ b/crates/graphql_soup/src/inputs.rs
@@ -126,7 +126,7 @@ impl GroupedSoupInitialInput {
.unwrap_or_default();
let sort_method = self
.sort_method
- .map(SimpleSortMethod::from)
+ .map(GraphqlSimpleSortMethod::into_model)
.unwrap_or(SimpleSortMethod::ViewedUpdated);
let limit = self.limit.unwrap_or(20).min(500);
@@ -271,7 +271,7 @@ impl SoupInitialInput {
.unwrap_or_default();
let sort = self
.sort_method
- .map(SimpleSortMethod::from)
+ .map(GraphqlSimpleSortMethod::into_model)
.unwrap_or(SimpleSortMethod::ViewedAt);
Ok(SoupRequest {
@@ -608,7 +608,7 @@ impl IntoFilterExpr<DocumentLiteral> for GraphqlDocumentLiteral {
Self::NotificationDone(done) => DocumentLiteral::NotificationDone(done),
Self::NotificationSeen(seen) => DocumentLiteral::NotificationSeen(seen),
Self::IncludeCbmAtmNc(include) => DocumentLiteral::IncludeCbmAtmNc(include),
- Self::SubType(sub_type) => DocumentLiteral::SubType(sub_type.into()),
+ Self::SubType(sub_type) => DocumentLiteral::SubType(sub_type.into_model()),
Self::IsEmailAttachment(value) => DocumentLiteral::IsEmailAttachment(value),
Self::CreatedAt(date) => DocumentLiteral::CreatedAt(date.into_ast()?),
Self::UpdatedAt(date) => DocumentLiteral::UpdatedAt(date.into_ast()?),
@@ -626,11 +626,12 @@ enum GraphqlDocumentSubType {
Snippet,
}
-impl From<GraphqlDocumentSubType> for DocumentSubType {
- fn from(value: GraphqlDocumentSubType) -> Self {
- match value {
- GraphqlDocumentSubType::Task => Self::Task,
- GraphqlDocumentSubType::Snippet => Self::Snippet,
+impl GraphqlDocumentSubType {
+ /// Convert this GraphQL subtype into the document-filter model.
+ fn into_model(self) -> DocumentSubType {
+ match self {
+ Self::Task => DocumentSubType::Task,
+ Self::Snippet => DocumentSubType::Snippet,
}
}
}
@@ -703,7 +704,7 @@ impl IntoFilterExpr<ChatLiteral> for GraphqlChatLiteral {
fn into_expr(self) -> async_graphql::Result<Expr<ChatLiteral>> {
let literal = match self {
Self::ProjectId(id) => ChatLiteral::ProjectId(parse_id(id, "projectId")?),
- Self::Role(role) => ChatLiteral::Role(role.into()),
+ Self::Role(role) => ChatLiteral::Role(role.into_model()),
Self::ChatId(id) => ChatLiteral::ChatId(parse_id(id, "chatId")?),
Self::Owner(owner) => ChatLiteral::Owner(parse_macro_user_id(owner, "owner")?),
Self::Importance(importance) => ChatLiteral::Importance(importance),
@@ -727,12 +728,13 @@ enum GraphqlChatRole {
Assistant,
}
-impl From<GraphqlChatRole> for ChatRole {
- fn from(value: GraphqlChatRole) -> Self {
- match value {
- GraphqlChatRole::User => Self::User,
- GraphqlChatRole::System => Self::System,
- GraphqlChatRole::Assistant => Self::Assistant,
+impl GraphqlChatRole {
+ /// Convert this GraphQL role into the chat-filter model.
+ fn into_model(self) -> ChatRole {
+ match self {
+ Self::User => ChatRole::User,
+ Self::System => ChatRole::System,
+ Self::Assistant => ChatRole::Assistant,
}
}
}
@@ -784,7 +786,7 @@ impl IntoFilterExpr<EmailLiteral> for GraphqlEmailLiteral {
Self::Importance(importance) => EmailLiteral::Importance(importance),
Self::NotificationDone(done) => EmailLiteral::NotificationDone(done),
Self::NotificationSeen(seen) => EmailLiteral::NotificationSeen(seen),
- Self::Shared(shared) => EmailLiteral::Shared(shared.into()),
+ Self::Shared(shared) => EmailLiteral::Shared(shared.into_model()),
Self::CalendarOnly(calendar_only) => EmailLiteral::CalendarOnly(calendar_only),
Self::CreatedAt(date) => EmailLiteral::CreatedAt(date.into_ast()?),
Self::UpdatedAt(date) => EmailLiteral::UpdatedAt(date.into_ast()?),
@@ -834,12 +836,13 @@ enum GraphqlSharedEmailFilter {
Only,
}
-impl From<GraphqlSharedEmailFilter> for SharedEmailFilter {
- fn from(value: GraphqlSharedEmailFilter) -> Self {
- match value {
- GraphqlSharedEmailFilter::Exclude => Self::Exclude,
- GraphqlSharedEmailFilter::Include => Self::Include,
- GraphqlSharedEmailFilter::Only => Self::Only,
+impl GraphqlSharedEmailFilter {
+ /// Convert this GraphQL option into the shared-email filter model.
+ fn into_model(self) -> SharedEmailFilter {
+ match self {
+ Self::Exclude => SharedEmailFilter::Exclude,
+ Self::Include => SharedEmailFilter::Include,
+ Self::Only => SharedEmailFilter::Only,
}
}
}
@@ -885,7 +888,9 @@ impl IntoFilterExpr<ChannelLiteral> for GraphqlChannelLiteral {
Self::TeamId(id) => ChannelLiteral::TeamId(parse_id(id, "teamId")?),
Self::ChannelId(id) => ChannelLiteral::ChannelId(parse_id(id, "channelId")?),
Self::Sender(sender) => ChannelLiteral::Sender(parse_macro_user_id(sender, "sender")?),
- Self::ChannelType(channel_type) => ChannelLiteral::ChannelType(channel_type.into()),
+ Self::ChannelType(channel_type) => {
+ ChannelLiteral::ChannelType(channel_type.into_model())
+ }
Self::Importance(importance) => ChannelLiteral::Importance(importance),
Self::IsParticipant(is_participant) => ChannelLiteral::IsParticipant(is_participant),
Self::NotificationDone(done) => ChannelLiteral::NotificationDone(done),
@@ -908,13 +913,14 @@ enum GraphqlChannelTypeFilter {
Team,
}
-impl From<GraphqlChannelTypeFilter> for ChannelTypeFilter {
- fn from(value: GraphqlChannelTypeFilter) -> Self {
- match value {
- GraphqlChannelTypeFilter::Public => Self::Public,
- GraphqlChannelTypeFilter::Private => Self::Private,
- GraphqlChannelTypeFilter::DirectMessage => Self::DirectMessage,
- GraphqlChannelTypeFilter::Team => Self::Team,
+impl GraphqlChannelTypeFilter {
+ /// Convert this GraphQL option into the channel-filter model.
+ fn into_model(self) -> ChannelTypeFilter {
+ match self {
+ Self::Public => ChannelTypeFilter::Public,
+ Self::Private => ChannelTypeFilter::Private,
+ Self::DirectMessage => ChannelTypeFilter::DirectMessage,
+ Self::Team => ChannelTypeFilter::Team,
}
}
}
@@ -979,7 +985,7 @@ impl IntoFilterExpr<CallLiteral> for GraphqlCallLiteral {
Self::Speaker(speaker) => {
CallLiteral::Speaker(parse_macro_user_id(speaker, "speaker")?)
}
- Self::Status(status) => CallLiteral::Status(status.into()),
+ Self::Status(status) => CallLiteral::Status(status.into_model()),
Self::Attended(attended) => CallLiteral::Attended(attended),
};
Ok(Expr::val(literal))
@@ -997,12 +1003,13 @@ enum GraphqlCallStatus {
Unattended,
}
-impl From<GraphqlCallStatus> for CallStatus {
- fn from(value: GraphqlCallStatus) -> Self {
- match value {
- GraphqlCallStatus::Attended => Self::Attended,
- GraphqlCallStatus::Missed => Self::Missed,
- GraphqlCallStatus::Unattended => Self::Unattended,
+impl GraphqlCallStatus {
+ /// Convert this GraphQL status into the call-filter model.
+ fn into_model(self) -> CallStatus {
+ match self {
+ Self::Attended => CallStatus::Attended,
+ Self::Missed => CallStatus::Missed,
+ Self::Unattended => CallStatus::Unattended,
}
}
}
@@ -1077,13 +1084,14 @@ pub enum GraphqlSimpleSortMethod {
ViewedUpdated,
}
-impl From<GraphqlSimpleSortMethod> for SimpleSortMethod {
- fn from(value: GraphqlSimpleSortMethod) -> Self {
- match value {
- GraphqlSimpleSortMethod::ViewedAt => SimpleSortMethod::ViewedAt,
- GraphqlSimpleSortMethod::CreatedAt => SimpleSortMethod::CreatedAt,
- GraphqlSimpleSortMethod::UpdatedAt => SimpleSortMethod::UpdatedAt,
- GraphqlSimpleSortMethod::ViewedUpdated => SimpleSortMethod::ViewedUpdated,
+impl GraphqlSimpleSortMethod {
+ /// Convert this GraphQL sort method into the Soup-domain model.
+ pub fn into_model(self) -> SimpleSortMethod {
+ match self {
+ Self::ViewedAt => SimpleSortMethod::ViewedAt,
+ Self::CreatedAt => SimpleSortMethod::CreatedAt,
+ Self::UpdatedAt => SimpleSortMethod::UpdatedAt,
+ Self::ViewedUpdated => SimpleSortMethod::ViewedUpdated,
}
}
}
diff --git a/crates/graphql_soup/src/lib.rs b/crates/graphql_soup/src/lib.rs
index 8c8560e498..d9c4cd748e 100644
--- a/crates/graphql_soup/src/lib.rs
+++ b/crates/graphql_soup/src/lib.rs
@@ -16,9 +16,9 @@ mod resolvers;
pub use graphql_common::{GraphqlRequestParts, GraphqlSoupEntityType};
pub use inputs::{GraphqlSimpleSortMethod, GroupedSoupInput, SoupInput};
pub use objects::{
- GraphqlSoupBin, GraphqlSoupCall, GraphqlSoupChannel, GraphqlSoupChannelThread, GraphqlSoupChat,
- GraphqlSoupCrmCompany, GraphqlSoupDocument, GraphqlSoupDocumentSubType, GraphqlSoupEmailThread,
- GraphqlSoupEntity, GraphqlSoupForeignEntity, GraphqlSoupItem, GraphqlSoupProject, GroupedSoup,
- SoupEntityEdges, SoupPage,
+ GraphqlSoupBin, GraphqlSoupCall, GraphqlSoupChannel, GraphqlSoupChannelMessage,
+ GraphqlSoupChannelMessagePreview, GraphqlSoupChat, GraphqlSoupCrmCompany, GraphqlSoupDocument,
+ GraphqlSoupDocumentSubType, GraphqlSoupEmailThread, GraphqlSoupEntity,
+ GraphqlSoupForeignEntity, GraphqlSoupProject, GroupedSoup, SoupEntityEdges, SoupPage,
};
pub use resolvers::{resolve_grouped_soup, resolve_soup, resolve_soup_updates};
diff --git a/crates/graphql_soup/src/objects.rs b/crates/graphql_soup/src/objects.rs
index 49c4a4bccc..a3d534275b 100644
--- a/crates/graphql_soup/src/objects.rs
+++ b/crates/graphql_soup/src/objects.rs
@@ -1,5 +1,8 @@
-use async_graphql::{ID, Json, Object, ObjectType, SimpleObject, Union};
-use graphql_common::GraphqlSoupEntityType;
+use async_graphql::{
+ Context, ID, Interface, Json, Object, ObjectType, OutputType, SimpleObject, Union,
+};
+use graphql_common::{GraphqlEntity, GraphqlSoupEntityType};
+use graphql_permission::GraphqlEntityPermission;
use models_pagination::PaginatedOpaqueCursor;
use models_soup::{
call_record::{SoupCallRecord, SoupCallRecordParticipant},
@@ -24,44 +27,87 @@ use uuid::Uuid;
/// The concrete edge object is supplied by the schema composition crate and
/// flattened into each Soup entity's GraphQL fields.
pub trait SoupEntityEdges: ObjectType + Clone + Send + Sync + 'static {
+ /// GraphQL property object supplied by the property adapter.
+ type Property: OutputType;
+
+ /// GraphQL notification object supplied by the notification adapter.
+ type Notification: OutputType;
+
/// Construct the common/global edge object for a Soup entity.
/// This is for edges that apply to all soup entities, e.g. notifications
fn from_entity(entity: model_entity::Entity<'static>) -> Self;
+ /// Construct common/global edges for a channel message whose viewer
+ /// permission is inherited from its parent channel.
+ fn from_channel_message(message_id: Uuid, channel_id: Uuid) -> Self {
+ let _ = channel_id;
+ Self::from_entity(
+ model_entity::EntityType::ChannelMessage.with_entity_string(message_id.to_string()),
+ )
+ }
+
/// Additional fields attached only to email-thread entities.
type EmailThreadEdges: ObjectType + Clone + Send + Sync + 'static;
/// Construct the email-thread-specific edge object.
fn email_thread_edges(email_thread_id: Uuid) -> Self::EmailThreadEdges;
+
+ /// Resolve properties assigned to this entity.
+ fn resolve_properties(
+ &self,
+ ctx: &Context<'_>,
+ ) -> impl Future<Output = async_graphql::Result<Vec<Self::Property>>> + Send;
+
+ /// Resolve notifications associated with this entity.
+ fn resolve_notifications(
+ &self,
+ ctx: &Context<'_>,
+ ) -> impl Future<Output = async_graphql::Result<Vec<Self::Notification>>> + Send;
+
+ /// Resolve whether the authenticated viewer has favorited this entity.
+ fn resolve_is_favorited(
+ &self,
+ ctx: &Context<'_>,
+ ) -> impl Future<Output = async_graphql::Result<bool>> + Send;
+
+ /// Resolve the authenticated viewer's effective permission.
+ fn resolve_viewer_permission(
+ &self,
+ ctx: &Context<'_>,
+ ) -> impl Future<Output = async_graphql::Result<Option<GraphqlEntityPermission>>> + Send;
}
/// Page returned by `Query.soup`.
#[derive(SimpleObject)]
pub struct SoupPage<E: SoupEntityEdges> {
/// Items in the current page.
- items: Vec<GraphqlSoupItem<E>>,
+ items: Vec<GraphqlSoupEntity<E>>,
/// Opaque cursor for the next page, if one exists.
next_cursor: Option<String>,
/// Whether more items are available after this page.
has_more: bool,
}
-impl<E: SoupEntityEdges> From<PaginatedOpaqueCursor<SoupItem<()>>> for SoupPage<E> {
- fn from(page: PaginatedOpaqueCursor<SoupItem<()>>) -> Self {
+impl<E: SoupEntityEdges> SoupPage<E> {
+ /// Construct a GraphQL page from plain Soup items.
+ pub fn new(page: PaginatedOpaqueCursor<SoupItem<()>>) -> Self {
let has_more = page.next_cursor.is_some();
Self {
- items: page.items.into_iter().map(GraphqlSoupItem::from).collect(),
+ items: page.items.into_iter().map(GraphqlSoupEntity::new).collect(),
next_cursor: page.next_cursor,
has_more,
}
}
-}
-impl<E: SoupEntityEdges> From<PaginatedOpaqueCursor<EnrichedSoupItem>> for SoupPage<E> {
- fn from(page: PaginatedOpaqueCursor<EnrichedSoupItem>) -> Self {
+ /// Construct a GraphQL page from frecency-enriched Soup items.
+ pub fn new_from_enriched(page: PaginatedOpaqueCursor<EnrichedSoupItem>) -> Self {
let has_more = page.next_cursor.is_some();
Self {
- items: page.items.into_iter().map(GraphqlSoupItem::from).collect(),
+ items: page
+ .items
+ .into_iter()
+ .map(GraphqlSoupEntity::new_from_enriched)
+ .collect(),
next_cursor: page.next_cursor,
has_more,
}
@@ -75,8 +121,9 @@ pub struct GroupedSoup<E: SoupEntityEdges> {
bins: Vec<GraphqlSoupBin<E>>,
}
-impl<E: SoupEntityEdges> From<NestedSoupGroups<SoupPropertiesField>> for GroupedSoup<E> {
- fn from(groups: NestedSoupGroups<SoupPropertiesField>) -> Self {
+impl<E: SoupEntityEdges> GroupedSoup<E> {
+ /// Construct grouped GraphQL Soup bins from the domain grouping model.
+ pub fn new(groups: NestedSoupGroups<SoupPropertiesField>) -> Self {
Self {
bins: groups
.into_bins()
@@ -86,7 +133,7 @@ impl<E: SoupEntityEdges> From<NestedSoupGroups<SoupPropertiesField>> for Grouped
next_cursor: bin.next_cursor().map(ToOwned::to_owned),
items: bin
.into_items()
- .map(|item| GraphqlSoupItem::from(item.map_extra(|_| ())))
+ .map(|item| GraphqlSoupEntity::new(item.map_extra(|_| ())))
.collect(),
})
.collect(),
@@ -104,83 +151,113 @@ pub struct GraphqlSoupBin<E: SoupEntityEdges> {
/// Opaque cursor for the next page in this bin, if one exists.
next_cursor: Option<String>,
/// Items in this bin, ordered by their index within the group.
- items: Vec<GraphqlSoupItem<E>>,
-}
-
-/// GraphQL Soup item envelope.
-pub struct GraphqlSoupItem<E: SoupEntityEdges> {
- /// The unique identifier.
- id: String,
- /// The entity type.
- entity_type: GraphqlSoupEntityType,
- /// The frecency score.
- frecency_score: f64,
- /// The expanded Soup entity.
- entity: GraphqlSoupEntity<E>,
-}
-
-/// GraphQL representation of the soup item.
-#[Object(name = "GraphqlSoupItem")]
-impl<E> GraphqlSoupItem<E>
-where
- E: SoupEntityEdges,
-{
- /// The unique identifier.
- async fn id(&self) -> ID {
- ID(self.id.clone())
- }
-
- /// The entity type.
- async fn entity_type(&self) -> GraphqlSoupEntityType {
- self.entity_type
- }
-
- /// The frecency score.
- async fn frecency_score(&self) -> f64 {
- self.frecency_score
- }
-
- /// The expanded Soup entity.
- async fn entity(&self) -> &GraphqlSoupEntity<E> {
- &self.entity
- }
+ items: Vec<GraphqlSoupEntity<E>>,
}
-impl<E: SoupEntityEdges> From<SoupItem<()>> for GraphqlSoupItem<E> {
- fn from(item: SoupItem<()>) -> Self {
- let entity_ref = item.entity();
- Self {
- id: entity_ref.entity_id.into_owned(),
- entity_type: GraphqlSoupEntityType::from(entity_ref.entity_type),
- frecency_score: 0.0,
- entity: GraphqlSoupEntity::from(item),
- }
- }
-}
-
-impl<E: SoupEntityEdges> From<EnrichedSoupItem> for GraphqlSoupItem<E> {
- fn from(item: EnrichedSoupItem) -> Self {
+impl<E: SoupEntityEdges> GraphqlSoupEntity<E> {
+ /// Construct a GraphQL entity from a frecency-enriched Soup item.
+ pub fn new_from_enriched(item: EnrichedSoupItem) -> Self {
let EnrichedSoupItem {
item,
frecency_score,
..
} = item;
- let item = item.map_extra(|_| ());
- let entity_ref = item.entity();
-
- Self {
- id: entity_ref.entity_id.into_owned(),
- entity_type: GraphqlSoupEntityType::from(entity_ref.entity_type),
- frecency_score: frecency_score
- .map(|f| f.data.frecency_score)
- .unwrap_or_default(),
- entity: GraphqlSoupEntity::from(item),
+ let score = frecency_score.map(|f| f.data.frecency_score);
+ Self::new(item.map_extra(|_| ())).with_frecency(score)
+ }
+
+ /// Attach the viewer's frecency score for this entity.
+ fn with_frecency(mut self, score: Option<f64>) -> Self {
+ match &mut self {
+ Self::Document(entity) => entity.2 = score,
+ Self::Chat(entity) => entity.2 = score,
+ Self::Project(entity) => entity.2 = score,
+ Self::EmailThread(entity) => entity.2 = score,
+ Self::Channel(entity) => entity.2 = score,
+ Self::ChannelMessage(entity) => entity.2 = score,
+ Self::Call(entity) => entity.2 = score,
+ Self::CrmCompany(entity) => entity.2 = score,
+ Self::ForeignEntity(entity) => entity.2 = score,
}
+ self
}
}
-/// GraphQL union over expanded Soup entity variants.
-#[derive(Union)]
+/// Construct a canonical GraphQL entity reference.
+fn graphql_entity(
+ entity_type: model_entity::EntityType,
+ entity_id: impl ToString,
+) -> GraphqlEntity<'static> {
+ GraphqlEntity(entity_type.with_entity_string(entity_id.to_string()))
+}
+
+/// Metadata shared by every canonical Soup entity.
+#[derive(SimpleObject)]
+pub struct GraphqlEntityMetadata {
+ /// Owning user, when applicable.
+ owner_id: Option<String>,
+ /// Parent project, channel, or team, when applicable.
+ parent: Option<GraphqlEntity<'static>>,
+ /// Creation timestamp in RFC 3339 form.
+ created_at: Option<String>,
+ /// Last-update timestamp in RFC 3339 form.
+ updated_at: Option<String>,
+ /// Last-viewed timestamp in RFC 3339 form.
+ viewed_at: Option<String>,
+ /// Soft-deletion timestamp in RFC 3339 form.
+ deleted_at: Option<String>,
+}
+
+/// Common GraphQL interface over canonical Soup entity variants.
+#[derive(Interface)]
+#[graphql(
+ field(name = "id", ty = "ID", desc = "The canonical entity identifier."),
+ field(
+ name = "entity_type",
+ ty = "GraphqlSoupEntityType",
+ desc = "The canonical entity type."
+ ),
+ field(
+ name = "display_name",
+ ty = "Option<String>",
+ desc = "The user-facing entity name, when available."
+ ),
+ field(
+ name = "metadata",
+ ty = "GraphqlEntityMetadata",
+ desc = "Metadata shared across entity variants."
+ ),
+ field(
+ name = "properties",
+ method = "interface_properties",
+ ty = "Vec<E::Property>",
+ desc = "Properties assigned to this entity that the viewer may access."
+ ),
+ field(
+ name = "notifications",
+ method = "interface_notifications",
+ ty = "Vec<E::Notification>",
+ desc = "Notifications associated with this entity for the current viewer."
+ ),
+ field(
+ name = "isFavorited",
+ method = "interface_is_favorited",
+ ty = "bool",
+ desc = "Whether the current viewer has favorited this entity."
+ ),
+ field(
+ name = "viewerPermission",
+ method = "interface_viewer_permission",
+ ty = "Option<GraphqlEntityPermission>",
+ desc = "The current viewer's effective permission for this entity."
+ ),
+ field(
+ name = "frecencyScore",
+ method = "frecency_score",
+ ty = "Option<f64>",
+ desc = "The viewer's frecency score for this entity, when loaded."
+ )
+)]
pub enum GraphqlSoupEntity<E: SoupEntityEdges> {
/// Document entity.
Document(GraphqlSoupDocument<E>),
@@ -192,8 +269,8 @@ pub enum GraphqlSoupEntity<E: SoupEntityEdges> {
EmailThread(GraphqlSoupEmailThread<E>),
/// Channel entity.
Channel(GraphqlSoupChannel<E>),
- /// Channel thread entity.
- ChannelThread(GraphqlSoupChannelThread<E>),
+ /// Canonical channel-message entity.
+ ChannelMessage(GraphqlSoupChannelMessage<E>),
/// Call entity.
Call(GraphqlSoupCall<E>),
/// CRM company entity.
@@ -202,75 +279,73 @@ pub enum GraphqlSoupEntity<E: SoupEntityEdges> {
ForeignEntity(GraphqlSoupForeignEntity<E>),
}
-impl<E> From<SoupItem<()>> for GraphqlSoupEntity<E>
+impl<E> GraphqlSoupEntity<E>
where
E: SoupEntityEdges,
{
- fn from(item: SoupItem<()>) -> Self {
+ /// Construct a GraphQL entity from a plain Soup item.
+ pub fn new(item: SoupItem<()>) -> Self {
match item {
SoupItem::Document(item) => {
let edges = E::from_entity(
model_entity::EntityType::Document.with_entity_string(item.id.to_string()),
);
- Self::Document(GraphqlSoupDocument(item, edges))
+ Self::Document(GraphqlSoupDocument(item, edges, None))
}
SoupItem::Chat(item) => {
let edges = E::from_entity(
model_entity::EntityType::Chat.with_entity_string(item.id.to_string()),
);
- Self::Chat(GraphqlSoupChat(item, edges))
+ Self::Chat(GraphqlSoupChat(item, edges, None))
}
SoupItem::Project(item) => {
let edges = E::from_entity(
model_entity::EntityType::Project.with_entity_string(item.id.to_string()),
);
- Self::Project(GraphqlSoupProject(item, edges))
+ Self::Project(GraphqlSoupProject(item, edges, None))
}
SoupItem::EmailThread(item) => {
let edges = E::from_entity(
model_entity::EntityType::EmailThread
.with_entity_string(item.thread.id.to_string()),
);
- Self::EmailThread(GraphqlSoupEmailThread(item, edges))
+ Self::EmailThread(GraphqlSoupEmailThread(item, edges, None))
}
SoupItem::Channel(item) => {
let edges = E::from_entity(
model_entity::EntityType::Channel
.with_entity_string(item.channel.channel.id.0.to_string()),
);
- Self::Channel(GraphqlSoupChannel(item, edges))
+ Self::Channel(GraphqlSoupChannel(item, edges, None))
}
SoupItem::ChannelThread(item) => {
- let edges = E::from_entity(
- model_entity::EntityType::ChannelMessage
- .with_entity_string(item.id.to_string()),
- );
- Self::ChannelThread(GraphqlSoupChannelThread(item, edges))
+ let edges = E::from_channel_message(item.id, item.channel_id);
+ Self::ChannelMessage(GraphqlSoupChannelMessage(item, edges, None))
}
SoupItem::Call(item) => {
let edges = E::from_entity(
model_entity::EntityType::Call.with_entity_string(item.call_id.to_string()),
);
- Self::Call(GraphqlSoupCall(item, edges))
+ Self::Call(GraphqlSoupCall(item, edges, None))
}
SoupItem::CrmCompany(item) => {
let edges = E::from_entity(
model_entity::EntityType::CrmCompany.with_entity_string(item.id.to_string()),
);
- Self::CrmCompany(GraphqlSoupCrmCompany(item, edges))
+ Self::CrmCompany(GraphqlSoupCrmCompany(item, edges, None))
}
SoupItem::ForeignEntity(item) => {
let edges = E::from_entity(
model_entity::EntityType::ForeignEntity.with_entity_string(item.id.to_string()),
);
- Self::ForeignEntity(GraphqlSoupForeignEntity(item, edges))
+ Self::ForeignEntity(GraphqlSoupForeignEntity(item, edges, None))
}
}
}
}
/// GraphQL document entity.
-pub struct GraphqlSoupDocument<E: SoupEntityEdges>(SoupDocument<()>, E);
+pub struct GraphqlSoupDocument<E: SoupEntityEdges>(SoupDocument<()>, E, Option<f64>);
/// GraphQL representation of the soup document.
#[Object(name = "GraphqlSoupDocument")]
@@ -283,6 +358,31 @@ where
ID(self.0.id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::Document
+ }
+
+ /// User-visible display name.
+ async fn display_name(&self) -> Option<String> {
+ Some(self.0.name.clone())
+ }
+
+ /// Common document metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: Some(self.0.owner_id.as_ref().to_owned()),
+ parent: self
+ .0
+ .project_id
+ .map(|id| graphql_entity(model_entity::EntityType::Project, id)),
+ created_at: Some(self.0.created_at.to_rfc3339()),
+ updated_at: Some(self.0.updated_at.to_rfc3339()),
+ viewed_at: self.0.viewed_at.map(|ts| ts.to_rfc3339()),
+ deleted_at: self.0.deleted_at.map(|ts| ts.to_rfc3339()),
+ }
+ }
+
/// The name.
async fn name(&self) -> &str {
&self.0.name
@@ -328,7 +428,7 @@ where
self.0
.sub_type
.as_ref()
- .map(GraphqlSoupDocumentSubType::from)
+ .map(GraphqlSoupDocumentSubType::new)
}
#[graphql(flatten)]
@@ -336,34 +436,52 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
-/// GraphQL representation of the soup document sub type.
+/// represents the task subtype fields
#[derive(SimpleObject)]
-pub struct GraphqlSoupDocumentSubType {
- /// The kind.
- kind: &'static str,
- /// Whether the task is completed.
- is_completed: Option<bool>,
+pub struct GraphqlTaskSubType {
+ /// whether or not the task is complete
+ is_completed: bool,
}
-impl From<&SoupDocumentSubType> for GraphqlSoupDocumentSubType {
- fn from(value: &SoupDocumentSubType) -> Self {
+/// represents the snippet subtype fields
+#[derive(SimpleObject)]
+pub struct GraphqlSnippetSubType {
+ /// this object has nothing as a field but we need at least 1 field
+ nothing: bool,
+}
+
+/// GraphQL representation of the soup document sub type.
+#[derive(Union)]
+pub enum GraphqlSoupDocumentSubType {
+ /// the subtype is a task
+ Task(GraphqlTaskSubType),
+ /// the sub type is a snippet
+ Snippet(GraphqlSnippetSubType),
+}
+
+impl GraphqlSoupDocumentSubType {
+ /// Construct a GraphQL document subtype from the Soup model.
+ pub fn new(value: &SoupDocumentSubType) -> Self {
match value {
- SoupDocumentSubType::Task { is_completed } => Self {
- kind: "task",
- is_completed: Some(*is_completed),
- },
- SoupDocumentSubType::Snippet {} => Self {
- kind: "snippet",
- is_completed: None,
- },
+ SoupDocumentSubType::Task { is_completed } => Self::Task(GraphqlTaskSubType {
+ is_completed: *is_completed,
+ }),
+ SoupDocumentSubType::Snippet {} => {
+ Self::Snippet(GraphqlSnippetSubType { nothing: false })
+ }
}
}
}
/// GraphQL chat entity.
-pub struct GraphqlSoupChat<E: SoupEntityEdges>(SoupChat<()>, E);
+pub struct GraphqlSoupChat<E: SoupEntityEdges>(SoupChat<()>, E, Option<f64>);
/// GraphQL representation of the soup chat.
#[Object(name = "GraphqlSoupChat")]
@@ -376,6 +494,31 @@ where
ID(self.0.id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::Chat
+ }
+
+ /// User-visible display name.
+ async fn display_name(&self) -> Option<String> {
+ Some(self.0.name.clone())
+ }
+
+ /// Common chat metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: Some(self.0.owner_id.as_ref().to_owned()),
+ parent: self
+ .0
+ .project_id
+ .map(|id| graphql_entity(model_entity::EntityType::Project, id)),
+ created_at: Some(self.0.created_at.to_rfc3339()),
+ updated_at: Some(self.0.updated_at.to_rfc3339()),
+ viewed_at: self.0.viewed_at.map(|ts| ts.to_rfc3339()),
+ deleted_at: self.0.deleted_at.map(|ts| ts.to_rfc3339()),
+ }
+ }
+
/// The name.
async fn name(&self) -> &str {
&self.0.name
@@ -421,10 +564,15 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
/// GraphQL project entity.
-pub struct GraphqlSoupProject<E: SoupEntityEdges>(SoupProject<()>, E);
+pub struct GraphqlSoupProject<E: SoupEntityEdges>(SoupProject<()>, E, Option<f64>);
/// GraphQL representation of the soup project.
#[Object(name = "GraphqlSoupProject")]
@@ -437,6 +585,31 @@ where
ID(self.0.id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::Project
+ }
+
+ /// User-visible display name.
+ async fn display_name(&self) -> Option<String> {
+ Some(self.0.name.clone())
+ }
+
+ /// Common project metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: Some(self.0.owner_id.as_ref().to_owned()),
+ parent: self
+ .0
+ .parent_id
+ .map(|id| graphql_entity(model_entity::EntityType::Project, id)),
+ created_at: Some(self.0.created_at.to_rfc3339()),
+ updated_at: Some(self.0.updated_at.to_rfc3339()),
+ viewed_at: self.0.viewed_at.map(|ts| ts.to_rfc3339()),
+ deleted_at: self.0.deleted_at.map(|ts| ts.to_rfc3339()),
+ }
+ }
+
/// The name.
async fn name(&self) -> &str {
&self.0.name
@@ -477,6 +650,11 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
/// GraphQL representation of the soup email participant.
@@ -494,8 +672,9 @@ pub struct GraphqlSoupEmailParticipant {
sfs_photo_url: Option<String>,
}
-impl From<&SoupContact> for GraphqlSoupEmailParticipant {
- fn from(value: &SoupContact) -> Self {
+impl GraphqlSoupEmailParticipant {
+ /// Construct a GraphQL email participant from the Soup model.
+ pub fn new(value: &SoupContact) -> Self {
Self {
id: ID(value.id.to_string()),
link_id: ID(value.link_id.to_string()),
@@ -528,8 +707,9 @@ pub struct GraphqlSoupEmailLabel {
type_: &'static str,
}
-impl From<&SoupLabel> for GraphqlSoupEmailLabel {
- fn from(value: &SoupLabel) -> Self {
+impl GraphqlSoupEmailLabel {
+ /// Construct a GraphQL email label from the Soup model.
+ pub fn new(value: &SoupLabel) -> Self {
Self {
id: ID(value.id.to_string()),
link_id: ID(value.link_id.to_string()),
@@ -574,8 +754,9 @@ pub struct GraphqlSoupEmailAttachment {
created_at: String,
}
-impl From<&SoupAttachment> for GraphqlSoupEmailAttachment {
- fn from(value: &SoupAttachment) -> Self {
+impl GraphqlSoupEmailAttachment {
+ /// Construct a GraphQL email attachment from the Soup model.
+ pub fn new(value: &SoupAttachment) -> Self {
Self {
id: ID(value.id.to_string()),
message_id: ID(value.message_id.to_string()),
@@ -590,7 +771,11 @@ impl From<&SoupAttachment> for GraphqlSoupEmailAttachment {
}
/// GraphQL email thread entity.
-pub struct GraphqlSoupEmailThread<E: SoupEntityEdges>(SoupEnrichedEmailThreadPreview<()>, E);
+pub struct GraphqlSoupEmailThread<E: SoupEntityEdges>(
+ SoupEnrichedEmailThreadPreview<()>,
+ E,
+ Option<f64>,
+);
/// GraphQL representation of the soup email thread.
#[Object(name = "GraphqlSoupEmailThread")]
@@ -603,6 +788,33 @@ where
ID(self.0.thread.id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::EmailThread
+ }
+
+ /// User-visible display name.
+ async fn display_name(&self) -> Option<String> {
+ self.0.thread.name.clone()
+ }
+
+ /// Common email-thread metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: Some(self.0.thread.owner_id.as_ref().to_owned()),
+ parent: self
+ .0
+ .thread
+ .project_id
+ .as_ref()
+ .map(|id| graphql_entity(model_entity::EntityType::Project, id)),
+ created_at: Some(self.0.thread.created_at.to_rfc3339()),
+ updated_at: Some(self.0.thread.updated_at.to_rfc3339()),
+ viewed_at: self.0.thread.viewed_at.map(|ts| ts.to_rfc3339()),
+ deleted_at: None,
+ }
+ }
+
/// The identifier of the provider.
async fn provider_id(&self) -> Option<&str> {
self.0.thread.provider_id.as_deref()
@@ -708,7 +920,7 @@ where
self.0
.participants
.iter()
- .map(GraphqlSoupEmailParticipant::from)
+ .map(GraphqlSoupEmailParticipant::new)
.collect()
}
@@ -717,7 +929,7 @@ where
self.0
.attachments
.iter()
- .map(GraphqlSoupEmailAttachment::from)
+ .map(GraphqlSoupEmailAttachment::new)
.collect()
}
@@ -726,7 +938,7 @@ where
self.0
.labels
.iter()
- .map(GraphqlSoupEmailLabel::from)
+ .map(GraphqlSoupEmailLabel::new)
.collect()
}
@@ -736,6 +948,11 @@ where
self.1.clone()
}
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
+
/// the email thread edge
#[graphql(flatten)]
async fn email_thread_edges(&self) -> E::EmailThreadEdges {
@@ -779,58 +996,78 @@ impl GraphqlSoupChannelParticipant {
}
}
-/// GraphQL channel message summary.
-pub struct GraphqlSoupChannelMessage(ChannelMessage);
+/// Embedded, non-normalized channel-message preview.
+///
+/// This exposes `messageId`, not `id`, so partial preview data cannot
+/// overwrite a canonical channel-message record in normalized caches.
+pub struct GraphqlSoupChannelMessagePreview {
+ /// Partial message projection returned with a channel.
+ message: ChannelMessage,
+ /// Parent channel identity omitted by the REST preview projection.
+ channel_id: Uuid,
+}
-// NOTE: `id` (not `messageId`) — objects exposing `id: ID!` are treated as
-// normalized entities by clients' caches (presence-of-id convention).
+impl GraphqlSoupChannelMessagePreview {
+ /// Construct an embedded preview with its parent channel identity.
+ fn new(message: ChannelMessage, channel_id: Uuid) -> Self {
+ Self {
+ message,
+ channel_id,
+ }
+ }
+}
/// GraphQL representation of the soup channel message.
#[Object]
-impl GraphqlSoupChannelMessage {
- /// The unique identifier.
- async fn id(&self) -> ID {
- ID(self.0.message_id.to_string())
+impl GraphqlSoupChannelMessagePreview {
+ /// The projected message identifier.
+ async fn message_id(&self) -> ID {
+ ID(self.message.message_id.to_string())
+ }
+
+ /// The parent channel identifier.
+ async fn channel_id(&self) -> ID {
+ ID(self.channel_id.to_string())
}
/// The identifier of the thread.
async fn thread_id(&self) -> Option<ID> {
- self.0.thread_id.map(|id| ID(id.to_string()))
+ self.message.thread_id.map(|id| ID(id.to_string()))
}
/// The identifier of the sender.
async fn sender_id(&self) -> &str {
- &self.0.sender_id
+ &self.message.sender_id
}
/// The content.
async fn content(&self) -> &str {
- &self.0.content
+ &self.message.content
}
/// The created timestamp in RFC 3339 format.
async fn created_at(&self) -> String {
- self.0.created_at.to_rfc3339()
+ self.message.created_at.to_rfc3339()
}
/// The updated timestamp in RFC 3339 format.
async fn updated_at(&self) -> String {
- self.0.updated_at.to_rfc3339()
+ self.message.updated_at.to_rfc3339()
}
/// The deleted timestamp in RFC 3339 format.
async fn deleted_at(&self) -> Option<String> {
- self.0.deleted_at.map(|ts| ts.to_rfc3339())
+ self.message.deleted_at.map(|ts| ts.to_rfc3339())
}
/// The mentions.
async fn mentions(&self) -> &[String] {
- &self.0.mentions
+ &self.message.mentions
}
}
/// GraphQL channel entity.
-pub struct GraphqlSoupChannel<E: SoupEntityEdges>(SoupChannel, E);
+pub struct GraphqlSoupChannel<E: SoupEntityEdges>(SoupChannel, E, Option<f64>);
impl<E: SoupEntityEdges> GraphqlSoupChannel<E> {
/// Return the stable GraphQL name for a channel type.
@@ -855,6 +1092,33 @@ where
ID(self.0.channel.channel.id.0.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::Channel
+ }
+
+ /// User-visible display name.
+ async fn display_name(&self) -> Option<String> {
+ self.0.channel.channel.name.clone()
+ }
+
+ /// Common channel metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: Some(self.0.channel.channel.owner_id.as_ref().to_owned()),
+ parent: self
+ .0
+ .channel
+ .channel
+ .team_id
+ .map(|id| graphql_entity(model_entity::EntityType::Team, id)),
+ created_at: Some(self.0.channel.channel.created_at.to_rfc3339()),
+ updated_at: Some(self.0.channel.channel.updated_at.to_rfc3339()),
+ viewed_at: self.0.viewed_at.map(|ts| ts.to_rfc3339()),
+ deleted_at: None,
+ }
+ }
+
/// The name.
async fn name(&self) -> Option<&str> {
self.0.channel.channel.name.as_deref()
@@ -937,21 +1201,23 @@ where
}
/// The latest message.
- async fn latest_message(&self) -> Option<GraphqlSoupChannelMessage> {
+ async fn latest_message(&self) -> Option<GraphqlSoupChannelMessagePreview> {
+ let channel_id = self.0.channel.channel.id.0;
self.0
.latest_message
.latest_message
.clone()
- .map(GraphqlSoupChannelMessage)
+ .map(|message| GraphqlSoupChannelMessagePreview::new(message, channel_id))
}
/// The latest non thread message.
- async fn latest_non_thread_message(&self) -> Option<GraphqlSoupChannelMessage> {
+ async fn latest_non_thread_message(&self) -> Option<GraphqlSoupChannelMessagePreview> {
+ let channel_id = self.0.channel.channel.id.0;
self.0
.latest_message
.latest_non_thread_message
.clone()
- .map(GraphqlSoupChannelMessage)
+ .map(|message| GraphqlSoupChannelMessagePreview::new(message, channel_id))
}
#[graphql(flatten)]
@@ -959,14 +1225,20 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
-/// GraphQL channel thread entity.
-pub struct GraphqlSoupChannelThread<E: SoupEntityEdges>(SoupChannelThread, E);
+/// Canonical GraphQL channel-message entity represented by a top-level Soup
+/// thread row.
+pub struct GraphqlSoupChannelMessage<E: SoupEntityEdges>(SoupChannelThread, E, Option<f64>);
/// GraphQL representation of the soup channel thread.
-#[Object(name = "GraphqlSoupChannelThread")]
-impl<E> GraphqlSoupChannelThread<E>
+#[Object(name = "GraphqlSoupChannelMessage")]
+impl<E> GraphqlSoupChannelMessage<E>
where
E: SoupEntityEdges,
{
@@ -975,6 +1247,36 @@ where
ID(self.0.id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::ChannelMessage
+ }
+
+ /// Channel messages do not have a separate display name.
+ async fn display_name(&self) -> Option<String> {
+ None
+ }
+
+ /// The message content.
+ async fn content(&self) -> &str {
+ &self.0.content
+ }
+
+ /// Common channel-message metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: Some(self.0.sender_id.clone()),
+ parent: Some(graphql_entity(
+ model_entity::EntityType::Channel,
+ self.0.channel_id,
+ )),
+ created_at: Some(self.0.created_at.to_rfc3339()),
+ updated_at: Some(self.0.updated_at.to_rfc3339()),
+ viewed_at: None,
+ deleted_at: self.0.deleted_at.map(|ts| ts.to_rfc3339()),
+ }
+ }
+
/// The identifier of the channel.
async fn channel_id(&self) -> ID {
ID(self.0.channel_id.to_string())
@@ -985,11 +1287,6 @@ where
&self.0.sender_id
}
- /// The content.
- async fn content(&self) -> &str {
- &self.0.content
- }
-
/// The created timestamp in RFC 3339 format.
async fn created_at(&self) -> String {
self.0.created_at.to_rfc3339()
@@ -1015,6 +1312,11 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
/// GraphQL representation of the soup call participant.
@@ -1028,8 +1330,9 @@ pub struct GraphqlSoupCallParticipant {
left_at: Option<String>,
}
-impl From<&SoupCallRecordParticipant> for GraphqlSoupCallParticipant {
- fn from(value: &SoupCallRecordParticipant) -> Self {
+impl GraphqlSoupCallParticipant {
+ /// Construct a GraphQL call participant from the Soup model.
+ pub fn new(value: &SoupCallRecordParticipant) -> Self {
Self {
user_id: value.user_id.clone(),
joined_at: value.joined_at.to_rfc3339(),
@@ -1039,7 +1342,7 @@ impl From<&SoupCallRecordParticipant> for GraphqlSoupCallParticipant {
}
/// GraphQL call entity.
-pub struct GraphqlSoupCall<E: SoupEntityEdges>(SoupCallRecord<()>, E);
+pub struct GraphqlSoupCall<E: SoupEntityEdges>(SoupCallRecord<()>, E, Option<f64>);
/// GraphQL representation of the soup call.
#[Object(name = "GraphqlSoupCall")]
@@ -1052,6 +1355,34 @@ where
ID(self.0.call_id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::Call
+ }
+
+ /// User-visible call name.
+ async fn display_name(&self) -> Option<String> {
+ self.0
+ .custom_name
+ .clone()
+ .or_else(|| self.0.channel_name.clone())
+ }
+
+ /// Common call metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: Some(self.0.created_by.clone()),
+ parent: Some(graphql_entity(
+ model_entity::EntityType::Channel,
+ self.0.channel_id,
+ )),
+ created_at: Some(self.0.started_at.to_rfc3339()),
+ updated_at: self.0.ended_at.map(|ts| ts.to_rfc3339()),
+ viewed_at: None,
+ deleted_at: None,
+ }
+ }
+
/// The identifier of the channel.
async fn channel_id(&self) -> ID {
ID(self.0.channel_id.to_string())
@@ -1138,7 +1469,7 @@ where
self.0
.participants
.iter()
- .map(GraphqlSoupCallParticipant::from)
+ .map(GraphqlSoupCallParticipant::new)
.collect()
}
@@ -1147,10 +1478,15 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
/// GraphQL CRM company entity.
-pub struct GraphqlSoupCrmCompany<E: SoupEntityEdges>(SoupCrmCompany<()>, E);
+pub struct GraphqlSoupCrmCompany<E: SoupEntityEdges>(SoupCrmCompany<()>, E, Option<f64>);
/// GraphQL representation of the soup crm company.
#[Object(name = "GraphqlSoupCrmCompany")]
@@ -1163,6 +1499,31 @@ where
ID(self.0.id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::CrmCompany
+ }
+
+ /// User-visible company name.
+ async fn display_name(&self) -> Option<String> {
+ self.0.name.clone()
+ }
+
+ /// Common CRM-company metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: None,
+ parent: Some(graphql_entity(
+ model_entity::EntityType::Team,
+ self.0.team_id,
+ )),
+ created_at: Some(self.0.created_at.to_rfc3339()),
+ updated_at: Some(self.0.updated_at.to_rfc3339()),
+ viewed_at: self.0.viewed_at.map(|ts| ts.to_rfc3339()),
+ deleted_at: None,
+ }
+ }
+
/// The identifier of the team.
async fn team_id(&self) -> ID {
ID(self.0.team_id.to_string())
@@ -1217,10 +1578,15 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
/// GraphQL foreign entity.
-pub struct GraphqlSoupForeignEntity<E: SoupEntityEdges>(SoupForeignEntity, E);
+pub struct GraphqlSoupForeignEntity<E: SoupEntityEdges>(SoupForeignEntity, E, Option<f64>);
/// GraphQL representation of the soup foreign entity.
#[Object(name = "GraphqlSoupForeignEntity")]
@@ -1233,6 +1599,28 @@ where
ID(self.0.id.to_string())
}
+ /// Canonical entity kind.
+ async fn entity_type(&self) -> GraphqlSoupEntityType {
+ GraphqlSoupEntityType::ForeignEntity
+ }
+
+ /// Foreign entities do not expose a common display name.
+ async fn display_name(&self) -> Option<String> {
+ None
+ }
+
+ /// Common foreign-entity metadata.
+ async fn metadata(&self) -> GraphqlEntityMetadata {
+ GraphqlEntityMetadata {
+ owner_id: None,
+ parent: None,
+ created_at: Some(self.0.created_at.to_rfc3339()),
+ updated_at: Some(self.0.updated_at.to_rfc3339()),
+ viewed_at: None,
+ deleted_at: None,
+ }
+ }
+
/// The identifier of the foreign entity.
async fn foreign_entity_id(&self) -> &str {
&self.0.foreign_entity_id
@@ -1253,8 +1641,8 @@ where
&self.0.stored_for_auth_entity
}
- /// The metadata.
- async fn metadata(&self) -> Json<Value> {
+ /// Source-specific metadata.
+ async fn source_metadata(&self) -> Json<Value> {
Json(self.0.metadata.clone())
}
@@ -1273,4 +1661,64 @@ where
async fn edges(&self) -> E {
self.1.clone()
}
+
+ /// The viewer's frecency score for this entity, when loaded.
+ async fn frecency_score(&self) -> Option<f64> {
+ self.2
+ }
}
+
+/// Implement interface-only dispatch methods for fields whose concrete
+/// GraphQL definitions are supplied by the flattened edge object.
+macro_rules! impl_common_interface_edges {
+ ($($entity:ident),+ $(,)?) => {
+ $(
+ impl<E: SoupEntityEdges> $entity<E> {
+ /// Resolve shared properties through the composed edge adapter.
+ async fn interface_properties(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<Vec<E::Property>> {
+ self.1.resolve_properties(ctx).await
+ }
+
+ /// Resolve shared notifications through the composed edge adapter.
+ async fn interface_notifications(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<Vec<E::Notification>> {
+ self.1.resolve_notifications(ctx).await
+ }
+
+ /// Resolve shared favorite state through the composed edge adapter.
+ async fn interface_is_favorited(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<bool> {
+ self.1.resolve_is_favorited(ctx).await
+ }
+
+ /// Resolve shared viewer permission through the composed edge adapter.
+ async fn interface_viewer_permission(
+ &self,
+ ctx: &Context<'_>,
+ ) -> async_graphql::Result<Option<GraphqlEntityPermission>> {
+ self.1.resolve_viewer_permission(ctx).await
+ }
+
+ }
+ )+
+ };
+}
+
+impl_common_interface_edges!(
+ GraphqlSoupDocument,
+ GraphqlSoupChat,
+ GraphqlSoupProject,
+ GraphqlSoupEmailThread,
+ GraphqlSoupChannel,
+ GraphqlSoupChannelMessage,
+ GraphqlSoupCall,
+ GraphqlSoupCrmCompany,
+ GraphqlSoupForeignEntity,
+);
diff --git a/crates/graphql_soup/src/resolvers.rs b/crates/graphql_soup/src/resolvers.rs
index ac8e903820..d50dd029f5 100644
--- a/crates/graphql_soup/src/resolvers.rs
+++ b/crates/graphql_soup/src/resolvers.rs
@@ -20,14 +20,14 @@ use soup_realtime::domain::ports::SoupRealtimeSubscriptionService;
use crate::{
inputs::{GroupedSoupInput, SoupInput},
- objects::{GraphqlSoupItem, GroupedSoup, SoupEntityEdges, SoupPage},
+ objects::{GraphqlSoupEntity, GroupedSoup, SoupEntityEdges, SoupPage},
};
/// Subscribe to realtime Soup updates for the authenticated user.
pub async fn resolve_soup_updates<R, Auth, St, Edges>(
service: &R,
ctx: &Context<'_>,
-) -> async_graphql::Result<impl Stream<Item = GraphqlSoupItem<Edges>> + Send + 'static>
+) -> async_graphql::Result<impl Stream<Item = GraphqlSoupEntity<Edges>> + Send + 'static>
where
R: SoupRealtimeSubscriptionService,
Auth: MacroAuthorizationService,
@@ -40,7 +40,7 @@ where
Ok(async_stream::stream! {
while let Some(item) = receiver.recv().await {
- yield GraphqlSoupItem::from(item.as_ref().clone());
+ yield GraphqlSoupEntity::new(item.as_ref().clone());
}
})
}
@@ -64,7 +64,7 @@ where
let filters = request.cursor.filter().clone();
let items = service.get_user_soup_grouped(request).await?;
let groups: NestedSoupGroups<_, _> = items.collect();
- Ok(GroupedSoup::from(
+ Ok(GroupedSoup::new(
groups.with_next_cursors(sort_method, filters),
))
}
@@ -113,9 +113,9 @@ where
let page = service
.get_user_soup_with_frecency(request, team_receipt)
.await?;
- Ok(SoupPage::from(page.type_erase()))
+ Ok(SoupPage::new_from_enriched(page.type_erase()))
} else {
let page = service.get_user_soup(request, team_receipt).await?;
- Ok(SoupPage::from(page.type_erase()))
+ Ok(SoupPage::new(page.type_erase()))
}
}
diff --git a/crates/workspace-hack/Cargo.toml b/crates/workspace-hack/Cargo.toml
index 128950b25c..c4e1eacdce 100644
--- a/crates/workspace-hack/Cargo.toml
+++ b/crates/workspace-hack/Cargo.toml
@@ -17,7 +17,6 @@ publish = false
[dependencies]
ahash = { version = "0.8" }
aho-corasick = { version = "1" }
-async-graphql = { version = "7", features = ["dataloader"] }
aws-config = { version = "1", features = ["behavior-version-latest"] }
aws-credential-types = { version = "1", default-features = false, features = ["hardcoded-credentials", "test-util"] }
aws-runtime = { version = "1", default-features = false, features = ["event-stream", "http-02x", "http-1x", "sigv4a"] }
@@ -139,7 +138,6 @@ zeroize = { version = "1", features = ["derive"] }
[build-dependencies]
ahash = { version = "0.8" }
aho-corasick = { version = "1" }
-async-graphql = { version = "7", features = ["dataloader"] }
aws-config = { version = "1", features = ["behavior-version-latest"] }
aws-credential-types = { version = "1", default-features = false, features = ["hardcoded-credentials", "test-util"] }
aws-runtime = { version = "1", default-features = false, features = ["event-stream", "http-02x", "http-1x", "sigv4a"] }
diff --git a/services/document_storage_service/Cargo.toml b/services/document_storage_service/Cargo.toml
index b124994698..9c4754ff3f 100644
--- a/services/document_storage_service/Cargo.toml
+++ b/services/document_storage_service/Cargo.toml
@@ -55,9 +55,13 @@ cal = { path = "../../crates/cal", features = ["axum", "outbound"] }
call = { path = "../../crates/call" }
channel_bots = { path = "../../crates/channel_bots" }
channels = { path = "../../crates/channels", features = [
+ "entity_mutation",
"inbound",
"outbound",
] }
+chat = { path = "../../crates/chat", default-features = false, features = [
+ "outbound",
+] }
chrono = { workspace = true }
clap = { workspace = true }
cloudfront_sign = { workspace = true }
@@ -81,6 +85,7 @@ entity_access = { path = "../../crates/entity_access", features = [
"schema",
] }
entity_access_management = { path = "../../crates/entity_access_management" }
+entity_mutation = { path = "../../crates/entity_mutation" }
favorites = { path = "../../crates/favorites", features = [
"inbound",
"postgres",
@@ -157,6 +162,7 @@ redis = { workspace = true, features = [
] }
regex = { workspace = true }
reqwest = { workspace = true }
+rootcause = { workspace = true }
s3_key = { path = "../../crates/s3_key" }
saved_views = { path = "../../crates/saved_views" }
schemars = { workspace = true }
diff --git a/services/document_storage_service/src/api/context.rs b/services/document_storage_service/src/api/context.rs
index a28690430b..093938f4f2 100644
--- a/services/document_storage_service/src/api/context.rs
+++ b/services/document_storage_service/src/api/context.rs
@@ -166,9 +166,12 @@ pub(crate) type DssGraphqlSoupSchema = complete_graph::SharedSoupSchema<
AuthorizationService,
ApiContext,
complete_graph::PropertiesEntityPropertyWriter<PropertiesService, EntityAccessService>,
+ DssEntityMutationService,
Arc<ai_tools::ToolNotificationService>,
complete_graph::PropertiesEntityPropertyReader<PropertiesService, EntityAccessService>,
complete_graph::EmailServiceEmailContentReader<DssEmailService, EntityAccessService>,
+ Arc<FavoritesServiceType>,
+ Arc<EntityAccessService>,
>;
type SystemPropertiesService = SystemPropertiesServiceImpl<PgSystemPropertiesRepository>;
@@ -365,6 +368,27 @@ pub(crate) type DssCallWebhookState = WebhookRouterState<DssCallService>;
/// Type alias for the internal call router state.
pub(crate) type DssCallInternalState = InternalCallRouterState<DssCallService>;
+/// Chat service used by the unified entity mutation adapter.
+pub(crate) type DssChatMutationService = chat::domain::service::ChatServiceImpl<
+ chat::outbound::postgres::PgChatRepo,
+ (),
+ EntityAccessManagementService,
+>;
+
+/// Concrete unified entity mutation service wired into GraphQL.
+pub(crate) type DssEntityMutationService =
+ crate::service::entity_mutation::DssEntityMutationService<
+ DocumentService,
+ DssChatMutationService,
+ DssChannelService,
+ DssCallService,
+ DssEmailService,
+ ProjectService,
+ EntityAccessService,
+ FavoritesServiceType,
+ crate::outbound::entity_mutation::DssEntityLifecycleAdapter,
+ >;
+
/// Type alias for the favorites service.
pub(crate) type FavoritesServiceType = FavoritesServiceImpl<PgFavoritesRepo>;
@@ -418,6 +442,7 @@ pub(crate) struct ApiContext {
pub soup_router_state: DssSoupState,
pub graphql_soup_schema: DssGraphqlSoupSchema,
pub graphql_notification_reader: Arc<ai_tools::ToolNotificationService>,
+ pub graphql_entity_mutation_service: Arc<DssEntityMutationService>,
pub favorites_state: DssFavoritesState,
pub favorites_service: Arc<FavoritesServiceType>,
pub foreign_entity_state: DssForeignEntityState,
diff --git a/services/document_storage_service/src/api/graphql_soup.rs b/services/document_storage_service/src/api/graphql_soup.rs
index 1f91b48943..85be80e3aa 100644
--- a/services/document_storage_service/src/api/graphql_soup.rs
+++ b/services/document_storage_service/src/api/graphql_soup.rs
@@ -47,13 +47,15 @@ async fn graphql_handler(
request_parts: Parts,
request: GraphQLRequest,
) -> GraphQLResponse {
+ let acting_user = auth
+ .authorization
+ .as_ref()
+ .and_then(UserOrInternalServiceAuthorization::acting_user);
let request = graphql_query_context_data(
request.into_inner(),
&state,
- auth.authorization
- .as_ref()
- .and_then(UserOrInternalServiceAuthorization::acting_user)
- .map(|user| user.macro_user_id.clone()),
+ acting_user.map(|user| user.macro_user_id.clone()),
+ acting_user.and_then(|user| user.user_context.organization_id.map(i64::from)),
);
state
.graphql_soup_schema
@@ -107,6 +109,7 @@ fn graphql_query_context_data(
req: async_graphql::Request,
state: &ApiContext,
macro_user_id: Option<MacroUserIdStr<'static>>,
+ organization_id: Option<i64>,
) -> async_graphql::Request {
let req = req.data(state.clone());
@@ -127,19 +130,35 @@ fn graphql_query_context_data(
state.soup_router_state.email_service(),
state.entity_access_service.clone(),
);
+ let favorite_reader = state.favorites_service.clone();
+ let permission_reader = state.entity_access_service.clone();
+ let req = req
+ .data(entity_mutation::EntityMutationActor {
+ user_id: macro_user_id.clone(),
+ organization_id,
+ })
+ .data(state.graphql_entity_mutation_service.clone());
- req.data(macro_user_id.clone())
- .data(complete_graph::entity_properties_loader(
- macro_user_id.clone(),
- property_reader,
- ))
- .data(complete_graph::email_content_loader(
- macro_user_id.clone(),
- email_content_reader,
- ))
- .data(property_writer)
- .data(complete_graph::entity_notifications_loader(
- macro_user_id,
- state.graphql_notification_reader.clone(),
- ))
+ req.data(complete_graph::entity_properties_loader(
+ macro_user_id.clone(),
+ property_reader,
+ ))
+ .data(complete_graph::email_content_loader(
+ macro_user_id.clone(),
+ email_content_reader,
+ ))
+ .data(complete_graph::entity_favorite_loader(
+ macro_user_id.clone(),
+ favorite_reader,
+ ))
+ .data(complete_graph::entity_permission_loader(
+ macro_user_id.clone(),
+ organization_id,
+ permission_reader,
+ ))
+ .data(property_writer)
+ .data(complete_graph::entity_notifications_loader(
+ macro_user_id,
+ state.graphql_notification_reader.clone(),
+ ))
}
diff --git a/services/document_storage_service/src/api/mod.rs b/services/document_storage_service/src/api/mod.rs
index 12f15e21f3..edb7e9f1ff 100644
--- a/services/document_storage_service/src/api/mod.rs
+++ b/services/document_storage_service/src/api/mod.rs
@@ -20,7 +20,7 @@ use utoipa_swagger_ui::SwaggerUi;
// Utilities
pub(crate) mod context;
mod saved_views;
-mod util;
+pub(crate) mod util;
// Middleware
mod middleware;
diff --git a/services/document_storage_service/src/main.rs b/services/document_storage_service/src/main.rs
index 74dd70d095..6097897450 100644
--- a/services/document_storage_service/src/main.rs
+++ b/services/document_storage_service/src/main.rs
@@ -85,9 +85,9 @@ use macro_authorization::{
use macro_entrypoint::MacroEntrypoint;
use macro_env_var::maybe_env_vars;
use macro_event_broker::{KafkaEventPublisher, MacroEventBrokerService};
-use macro_service_urls::{
- AiEditingWorkerUrl, ConnectionGatewayUrl, LexicalServiceUrl, SyncServiceUrl,
-};
+#[cfg(feature = "delete_document_worker")]
+use macro_service_urls::AiEditingWorkerUrl;
+use macro_service_urls::{ConnectionGatewayUrl, LexicalServiceUrl, SyncServiceUrl};
use macro_sha_count_client::Redis;
use notification::domain::service::SqsNotificationIngress;
use notification::domain::service::{NotificationReaderService, PlatformArnConfig};
@@ -135,6 +135,7 @@ use tokio_util::{sync::CancellationToken, task::TaskTracker};
mod api;
mod config;
mod model;
+mod outbound;
mod service;
maybe_env_vars! {
@@ -444,6 +445,12 @@ async fn main() -> anyhow::Result<()> {
entity_access_management::outbound::PgRepository::new(db.clone()),
);
+ let chat_mutation_service =
+ Arc::new(chat::domain::service::ChatServiceImpl::new_without_tools(
+ chat::outbound::postgres::PgChatRepo::new(db.clone()),
+ entity_access_management_service.clone(),
+ ));
+
let project_service = Arc::new(ProjectServiceImpl::new(
PgProjectRepo::new(db.clone()),
S3ProjectUploadAdapter::new(
@@ -966,6 +973,25 @@ async fn main() -> anyhow::Result<()> {
let favorites_service = Arc::new(FavoritesServiceImpl::new(PgFavoritesRepo::new(db.clone())));
+ let redis_sha_client = Arc::new(Redis::new(redis_client));
+
+ let graphql_entity_mutation_service =
+ Arc::new(service::entity_mutation::DssEntityMutationService::new(
+ document_service.clone(),
+ chat_mutation_service,
+ channels_service.clone(),
+ call_service.clone(),
+ Arc::new(email_service.clone()),
+ project_service.clone(),
+ entity_access_service.clone(),
+ favorites_service.clone(),
+ Arc::new(outbound::entity_mutation::DssEntityLifecycleAdapter::new(
+ db.clone(),
+ redis_sha_client.clone(),
+ sqs_client.clone(),
+ )),
+ ));
+
let api_context = ApiContext {
contacts_ingress: contacts_ingress.clone(),
soup_router_state: SoupRouterState::from_arc(
@@ -988,11 +1014,12 @@ async fn main() -> anyhow::Result<()> {
soup_realtime_service,
),
graphql_notification_reader,
+ graphql_entity_mutation_service,
github_sync_service: Arc::new(github_sync_service_impl),
foreign_entity_state,
db: db.clone(),
readonly_db: readonly_pool::ReadOnlyPool(readonly_db.clone()),
- redis_client: Arc::new(Redis::new(redis_client)),
+ redis_client: redis_sha_client,
s3_client: s3,
dynamodb_client: Arc::new(dynamodb_client),
dynamo_db,
diff --git a/services/document_storage_service/src/openapi.rs b/services/document_storage_service/src/openapi.rs
index 9a84857dc5..6818634a03 100644
--- a/services/document_storage_service/src/openapi.rs
+++ b/services/document_storage_service/src/openapi.rs
@@ -4,6 +4,7 @@
mod api;
mod config;
mod model;
+mod outbound;
mod service;
use utoipa::OpenApi;
diff --git a/services/document_storage_service/src/outbound/entity_mutation.rs b/services/document_storage_service/src/outbound/entity_mutation.rs
new file mode 100644
index 0000000000..365cf905b4
--- /dev/null
+++ b/services/document_storage_service/src/outbound/entity_mutation.rs
@@ -0,0 +1,148 @@
+//! Adapter for document and email-thread lifecycle operations that still use
+//! the legacy database clients.
+
+use std::sync::Arc;
+
+use crate::{
+ api::util::count_occurrences,
+ service::entity_mutation::{EntityLifecycleService, LifecycleError},
+};
+use entity_mutation::EntityMutationActor;
+use macro_sha_count_client::Redis;
+use model_entity::{Entity, EntityType};
+use models_permissions::share_permission::UpdateSharePermissionRequestV2;
+use sqlx::PgPool;
+use sqs_client::search::{SearchQueueMessage, document::DocumentId};
+
+/// Wrap a legacy client failure as an internal lifecycle error.
+macro_rules! internal {
+ ($error:expr) => {
+ LifecycleError::Internal(rootcause::report!($error).into())
+ };
+}
+
+/// Map a direct row lookup failure, treating a missing row as `NotFound`.
+fn row_error(error: sqlx::Error) -> LifecycleError {
+ match error {
+ sqlx::Error::RowNotFound => LifecycleError::NotFound,
+ error => internal!(error),
+ }
+}
+
+/// Production lifecycle adapter backed by the legacy persistence clients.
+pub struct DssEntityLifecycleAdapter {
+ db: PgPool,
+ redis: Arc<Redis>,
+ sqs: Arc<sqs_client::SQS>,
+}
+
+impl DssEntityLifecycleAdapter {
+ /// Construct the adapter from concrete outbound dependencies.
+ pub fn new(db: PgPool, redis: Arc<Redis>, sqs: Arc<sqs_client::SQS>) -> Self {
+ Self { db, redis, sqs }
+ }
+}
+
+impl EntityLifecycleService for DssEntityLifecycleAdapter {
+ async fn update_thread_share_policy(
+ &self,
+ _actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ policy: UpdateSharePermissionRequestV2,
+ ) -> Result<Vec<Entity<'static>>, LifecycleError> {
+ // Threads get their share-permission row lazily; mirror the REST
+ // middleware's get-or-create so a first-time share succeeds. The
+ // caller has already proven Owner access, so the thread exists.
+ let permission =
+ macro_middleware::cloud_storage::thread::ensure_thread_exists::insert_thread_share_permissions(
+ &self.db,
+ &entity.entity_id,
+ )
+ .await
+ .map_err(|error| internal!(error))?;
+ let thread_id = uuid::Uuid::parse_str(&entity.entity_id)
+ .map_err(|error| LifecycleError::InvalidInput(format!("invalid thread id: {error}")))?;
+ let mut transaction = self.db.begin().await.map_err(|error| internal!(error))?;
+ macro_db_client::share_permission::edit::edit_thread_permission(
+ &mut transaction,
+ &thread_id,
+ &permission.share_permission_id,
+ &policy,
+ )
+ .await
+ .map_err(|error| internal!(error))?;
+ transaction
+ .commit()
+ .await
+ .map_err(|error| internal!(error))?;
+ Ok(Vec::new())
+ }
+
+ async fn restore_document(
+ &self,
+ _actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ ) -> Result<Vec<Entity<'static>>, LifecycleError> {
+ let document = macro_db_client::document::get_basic_document(&self.db, &entity.entity_id)
+ .await
+ .map_err(row_error)?;
+ macro_db_client::document::revert_delete::revert_delete_document(
+ &self.db,
+ &entity.entity_id,
+ document.project_id.as_deref(),
+ )
+ .await
+ .map_err(|error| internal!(error))?;
+ Ok(document
+ .project_id
+ .into_iter()
+ .map(|id| EntityType::Project.with_entity_string(id))
+ .collect())
+ }
+
+ async fn delete_document_permanently(
+ &self,
+ _actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ ) -> Result<Vec<Entity<'static>>, LifecycleError> {
+ let document = macro_db_client::document::get_basic_document(&self.db, &entity.entity_id)
+ .await
+ .map_err(row_error)?;
+ if document.file_type.as_deref() == Some("docx") {
+ let bom_parts = macro_db_client::document::get_bom_parts(&self.db, &entity.entity_id)
+ .await
+ .map_err(|error| internal!(error))?;
+ self.redis
+ .decrement_counts(&count_occurrences(
+ bom_parts.into_iter().map(|part| part.sha).collect(),
+ ))
+ .await
+ .map_err(|error| internal!(error))?;
+ }
+ macro_db_client::document::delete_document(&self.db, &entity.entity_id)
+ .await
+ .map_err(|error| internal!(error))?;
+ comms_db_client::entity_mentions::delete_entity_mentions_by_source(
+ &self.db,
+ vec![entity.entity_id.to_string()],
+ )
+ .await
+ .inspect_err(|error| tracing::error!(error = ?error, "unable to delete entity mentions"))
+ .ok();
+ self.sqs
+ .enqueue_document_delete(document.owner.as_ref(), &entity.entity_id)
+ .await
+ .map_err(|error| internal!(error))?;
+ self.sqs
+ .send_message_to_search_event_queue(SearchQueueMessage::RemoveDocument(DocumentId {
+ document_id: entity.entity_id.to_string(),
+ }))
+ .await
+ .map_err(|error| internal!(error))?;
+ Ok(document
+ .project_id
+ .into_iter()
+ .map(|id| EntityType::Project.with_entity_string(id))
+ .collect())
+ }
+}
diff --git a/services/document_storage_service/src/outbound/mod.rs b/services/document_storage_service/src/outbound/mod.rs
new file mode 100644
index 0000000000..da4a69ca4f
--- /dev/null
+++ b/services/document_storage_service/src/outbound/mod.rs
@@ -0,0 +1,3 @@
+//! Outbound adapters owned by document storage service composition.
+
+pub mod entity_mutation;
diff --git a/services/document_storage_service/src/service/entity_mutation.rs b/services/document_storage_service/src/service/entity_mutation.rs
new file mode 100644
index 0000000000..3ab0bd8e8a
--- /dev/null
+++ b/services/document_storage_service/src/service/entity_mutation.rs
@@ -0,0 +1,894 @@
+//! Document-storage router for the unified entity mutation domain port.
+//!
+//! This service is deliberately thin: each domain crate implements the
+//! capability traits in [`entity_mutation::capability`] and owns its own
+//! mapping onto its service methods, preconditions, and errors. The router
+//! resolves access receipts (typed per capability by each impl's associated
+//! `Receipt`), enforces the batch contract (ordering, bounded concurrency,
+//! partial success), validates cross-domain inputs such as move targets, and
+//! dispatches each item to the owning domain. The per-kind support matrix is
+//! encoded as exhaustive matches, so adding an [`EntityType`] fails
+//! compilation here until every capability decides whether to support it.
+//!
+//! Access-level requirements deliberately mirror the legacy REST handlers
+//! for each entity kind, including their asymmetries (for example, call
+//! permanent-deletion requires `Edit` while other kinds require `Owner`,
+//! and chat rename/move require `Owner` while documents require `Edit`).
+//! The requirement lives on each domain impl's associated `Receipt` type;
+//! do not "normalize" a level without an explicit product decision.
+
+use std::{future::Future, sync::Arc};
+
+use call::domain::ports::CallService;
+use channels::domain::ports::ChannelService;
+use chat::domain::ports::ChatService;
+use documents_hex::domain::ports::DocumentService;
+use email::domain::ports::EmailService;
+use entity_access::domain::{
+ models::{
+ AccessError, EditAccessLevel, EntityAccessReceipt, RequiredPermission, ViewAccessLevel,
+ },
+ ports::EntityAccessService,
+};
+use entity_mutation::{
+ DeleteEntityPermanently, DuplicateEntity, DuplicateEntityRequest, EntityMutationActor,
+ EntityMutationErrorCode, EntityMutationService, EntityMutationSuccess, MoveEntity,
+ MoveEntityRequest, MutateEntitiesResult, RenameEntity, RenameEntityRequest, RestoreEntity,
+ TrashEntity, UpdateEntitySharePolicy, UpdateEntitySharePolicyRequest,
+ capability::MoveEntityRequest as CapabilityMoveEntityRequest,
+};
+use favorites::domain::{models::FavoritesError, ports::FavoritesService};
+use futures::{StreamExt, stream};
+use model_entity::{Entity, EntityType};
+use models_permissions::share_permission::UpdateSharePermissionRequestV2;
+use projects_hex::domain::ports::ProjectService;
+
+#[cfg(test)]
+mod test;
+
+/// Upper bound on how many items of one batch run against downstream
+/// services at once. `buffered` preserves input order, so results still map
+/// one-to-one onto inputs.
+const MAX_CONCURRENT_ENTITY_MUTATIONS: usize = 16;
+
+/// Error returned by [`EntityLifecycleService`] operations.
+#[derive(Debug, thiserror::Error)]
+pub enum LifecycleError {
+ /// The requested entity does not exist.
+ #[error("entity not found")]
+ NotFound,
+ /// The request violates an input invariant.
+ #[error("invalid lifecycle input: {0}")]
+ InvalidInput(String),
+ /// Infrastructure or persistence failed.
+ #[error("internal lifecycle failure: {0}")]
+ Internal(rootcause::Report),
+}
+
+/// Document and email-thread mutations still orchestrated directly against
+/// persistence instead of a domain service.
+///
+/// Each method should migrate behind the domain port that owns its entity
+/// kind and become a capability-trait impl there (projects already
+/// graduated); delete this trait once it is empty.
+pub trait EntityLifecycleService: Send + Sync + 'static {
+ /// Update an email thread's share policy.
+ fn update_thread_share_policy(
+ &self,
+ actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ policy: UpdateSharePermissionRequestV2,
+ ) -> impl Future<Output = Result<Vec<Entity<'static>>, LifecycleError>> + Send;
+ /// Restore a document.
+ fn restore_document(
+ &self,
+ actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ ) -> impl Future<Output = Result<Vec<Entity<'static>>, LifecycleError>> + Send;
+ /// Permanently delete a document.
+ fn delete_document_permanently(
+ &self,
+ actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ ) -> impl Future<Output = Result<Vec<Entity<'static>>, LifecycleError>> + Send;
+}
+
+/// Result of one mutation routed by this service.
+type EntityMutationResult = MutateEntitiesResult<'static>;
+
+/// Map an access failure on the requested entity onto the public vocabulary.
+fn access_failure(error: AccessError) -> EntityMutationErrorCode {
+ match error {
+ error @ (AccessError::Unauthorized | AccessError::UnauthorizedWithMessage(_)) => {
+ EntityMutationErrorCode::forbidden(rootcause::report!(error))
+ }
+ error @ AccessError::NotFound(_) => {
+ EntityMutationErrorCode::not_found(rootcause::report!(error))
+ }
+ error @ AccessError::BadRequest(_) => {
+ EntityMutationErrorCode::invalid(rootcause::report!(error))
+ }
+ error @ (AccessError::DatabaseError(_) | AccessError::Internal) => {
+ EntityMutationErrorCode::internal(rootcause::report!(error))
+ }
+ }
+}
+
+/// Map an access failure on the target project of a move.
+fn target_project_failure(error: AccessError) -> EntityMutationErrorCode {
+ access_failure(error)
+}
+
+/// Map a favorites-domain failure onto the public vocabulary.
+fn favorites_failure(error: FavoritesError) -> EntityMutationErrorCode {
+ match error {
+ error @ FavoritesError::NotFound => {
+ EntityMutationErrorCode::not_found(rootcause::report!(error))
+ }
+ error @ FavoritesError::BadRequest(_) => {
+ EntityMutationErrorCode::invalid(rootcause::report!(error))
+ }
+ error @ FavoritesError::Unauthorized => {
+ EntityMutationErrorCode::forbidden(rootcause::report!(error))
+ }
+ error @ FavoritesError::Internal(_) => {
+ EntityMutationErrorCode::internal(rootcause::report!(error))
+ }
+ }
+}
+
+/// Map a lifecycle-port failure onto the public vocabulary.
+fn lifecycle_failure(error: LifecycleError) -> EntityMutationErrorCode {
+ match error {
+ LifecycleError::NotFound => {
+ EntityMutationErrorCode::not_found(rootcause::report!(LifecycleError::NotFound))
+ }
+ LifecycleError::InvalidInput(message) => EntityMutationErrorCode::invalid(
+ rootcause::report!(LifecycleError::InvalidInput(message)),
+ ),
+ LifecycleError::Internal(report) => {
+ EntityMutationErrorCode::internal(rootcause::report!(LifecycleError::Internal(report)))
+ }
+ }
+}
+
+/// Build an unsupported-operation result for an entity.
+fn unsupported(entity: Entity<'static>, operation: &'static str) -> EntityMutationResult {
+ Err(EntityMutationErrorCode::unsupported(
+ rootcause::report!(entity).attach(operation),
+ ))
+}
+
+/// Build a success result, guaranteeing the requested entity itself is
+/// listed as affected ahead of any extra records the domain reported.
+fn success_with_affected(
+ requested: Entity<'static>,
+ affected: Vec<Entity<'static>>,
+) -> EntityMutationResult {
+ let mut affected_entities = affected;
+ if !affected_entities.contains(&requested) {
+ affected_entities.insert(0, requested);
+ }
+ Ok(EntityMutationSuccess { affected_entities })
+}
+
+/// Entity kinds a user may favorite.
+///
+/// Exhaustive so a new [`EntityType`] variant is a deliberate decision here,
+/// not a silent default.
+fn favoritable(entity_type: EntityType) -> bool {
+ match entity_type {
+ EntityType::Document
+ | EntityType::Project
+ | EntityType::Chat
+ | EntityType::Channel
+ | EntityType::EmailThread
+ | EntityType::Call
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => true,
+ EntityType::User | EntityType::Team | EntityType::ChannelMessage => false,
+ }
+}
+
+async fn collect_ordered<F>(futures: impl IntoIterator<Item = F>) -> Vec<EntityMutationResult>
+where
+ F: Future<Output = EntityMutationResult>,
+{
+ stream::iter(futures)
+ .buffered(MAX_CONCURRENT_ENTITY_MUTATIONS)
+ .collect()
+ .await
+}
+
+/// Unified entity mutation router wired from the domain services.
+#[derive(Clone)]
+pub struct DssEntityMutationService<D, H, C, K, E, P, A, F, L> {
+ documents: Arc<D>,
+ chats: Arc<H>,
+ channels: Arc<C>,
+ calls: Arc<K>,
+ email: Arc<E>,
+ projects: Arc<P>,
+ access: Arc<A>,
+ favorites: Arc<F>,
+ lifecycle: Arc<L>,
+}
+
+impl<D, H, C, K, E, P, A, F, L> DssEntityMutationService<D, H, C, K, E, P, A, F, L> {
+ /// Compose the unified mutation router from domain services.
+ #[expect(
+ clippy::too_many_arguments,
+ reason = "composition root wiring: one dependency per domain"
+ )]
+ pub fn new(
+ documents: Arc<D>,
+ chats: Arc<H>,
+ channels: Arc<C>,
+ calls: Arc<K>,
+ email: Arc<E>,
+ projects: Arc<P>,
+ access: Arc<A>,
+ favorites: Arc<F>,
+ lifecycle: Arc<L>,
+ ) -> Self {
+ Self {
+ documents,
+ chats,
+ channels,
+ calls,
+ email,
+ projects,
+ access,
+ favorites,
+ lifecycle,
+ }
+ }
+}
+
+impl<D, H, C, K, E, P, A, F, L> DssEntityMutationService<D, H, C, K, E, P, A, F, L>
+where
+ D: DocumentService
+ + RenameEntity
+ + MoveEntity
+ + UpdateEntitySharePolicy
+ + TrashEntity
+ + DuplicateEntity,
+ H: ChatService
+ + RenameEntity
+ + MoveEntity
+ + UpdateEntitySharePolicy
+ + TrashEntity
+ + RestoreEntity
+ + DeleteEntityPermanently
+ + DuplicateEntity,
+ C: ChannelService + RenameEntity + DeleteEntityPermanently,
+ K: CallService + RenameEntity + UpdateEntitySharePolicy + DeleteEntityPermanently,
+ E: EmailService + MoveEntity,
+ P: ProjectService
+ + RenameEntity
+ + MoveEntity
+ + UpdateEntitySharePolicy
+ + TrashEntity
+ + RestoreEntity
+ + DeleteEntityPermanently,
+ A: EntityAccessService,
+ F: FavoritesService,
+ L: EntityLifecycleService,
+{
+ /// Resolve the access receipt a capability impl requires.
+ async fn receipt<T: RequiredPermission>(
+ &self,
+ actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ ) -> Result<EntityAccessReceipt<T>, EntityMutationErrorCode> {
+ self.access
+ .generate_entity_access_receipt::<T>(
+ &actor.user_id,
+ actor.organization_id,
+ &entity.entity_id,
+ entity.entity_type,
+ )
+ .await
+ .map_err(access_failure)
+ }
+
+ /// Require edit access on the target project of a move.
+ async fn target_project(
+ &self,
+ actor: &EntityMutationActor,
+ project_id: &str,
+ ) -> Result<EntityAccessReceipt<EditAccessLevel>, EntityMutationErrorCode> {
+ self.access
+ .generate_entity_access_receipt::<EditAccessLevel>(
+ &actor.user_id,
+ actor.organization_id,
+ project_id,
+ EntityType::Project,
+ )
+ .await
+ .map_err(target_project_failure)
+ }
+
+ /// Resolve a receipt and dispatch a rename to the owning domain.
+ async fn rename_with<S: RenameEntity>(
+ &self,
+ service: &S,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ display_name: String,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ let receipt = self.receipt::<S::Receipt>(actor, requested).await?;
+ service
+ .rename_entity(requested.clone(), receipt, display_name)
+ .await
+ }
+
+ /// Resolve receipts and dispatch a move to the owning domain.
+ async fn move_with<S: MoveEntity>(
+ &self,
+ service: &S,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ project_id: Option<String>,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ let receipt = self.receipt::<S::Receipt>(actor, requested).await?;
+ let request = match project_id {
+ Some(project_id) => {
+ let project_receipt = self.target_project(actor, &project_id).await?;
+ CapabilityMoveEntityRequest::MoveToProject {
+ entity: requested.clone(),
+ receipt,
+ project_id,
+ project_receipt,
+ }
+ }
+ None => CapabilityMoveEntityRequest::MoveToRoot {
+ entity: requested.clone(),
+ receipt,
+ },
+ };
+ service.move_entity(request).await
+ }
+
+ /// Resolve a receipt and dispatch a share-policy update.
+ async fn share_with<S: UpdateEntitySharePolicy>(
+ &self,
+ service: &S,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ policy: UpdateSharePermissionRequestV2,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ let receipt = self.receipt::<S::Receipt>(actor, requested).await?;
+ service
+ .update_share_policy(requested.clone(), receipt, policy)
+ .await
+ }
+
+ /// Resolve a receipt and dispatch a trash operation.
+ async fn trash_with<S: TrashEntity>(
+ &self,
+ service: &S,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ let receipt = self.receipt::<S::Receipt>(actor, requested).await?;
+ service.trash_entity(requested.clone(), receipt).await
+ }
+
+ /// Resolve a receipt and dispatch a restore operation.
+ async fn restore_with<S: RestoreEntity>(
+ &self,
+ service: &S,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ let receipt = self.receipt::<S::Receipt>(actor, requested).await?;
+ service.restore_entity(requested.clone(), receipt).await
+ }
+
+ /// Resolve a receipt and dispatch a permanent deletion.
+ async fn delete_with<S: DeleteEntityPermanently>(
+ &self,
+ service: &S,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ let receipt = self.receipt::<S::Receipt>(actor, requested).await?;
+ service
+ .delete_entity_permanently(requested.clone(), receipt)
+ .await
+ }
+
+ /// Resolve a receipt and dispatch a duplication.
+ async fn duplicate_with<S: DuplicateEntity>(
+ &self,
+ service: &S,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ display_name: Option<String>,
+ ) -> Result<Entity<'static>, EntityMutationErrorCode> {
+ let receipt = self.receipt::<S::Receipt>(actor, requested).await?;
+ service
+ .duplicate_entity(
+ requested.clone(),
+ receipt,
+ actor.user_id.clone(),
+ display_name,
+ )
+ .await
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %request.entity.entity_type, entity_id = %request.entity.entity_id))]
+ async fn rename_one(
+ &self,
+ actor: &EntityMutationActor,
+ request: RenameEntityRequest,
+ ) -> EntityMutationResult {
+ let RenameEntityRequest {
+ entity: requested,
+ display_name,
+ } = request;
+ let result = match requested.entity_type {
+ EntityType::Document => {
+ self.rename_with(&*self.documents, actor, &requested, display_name)
+ .await
+ }
+ EntityType::Chat => {
+ self.rename_with(&*self.chats, actor, &requested, display_name)
+ .await
+ }
+ EntityType::Channel => {
+ self.rename_with(&*self.channels, actor, &requested, display_name)
+ .await
+ }
+ EntityType::Call => {
+ self.rename_with(&*self.calls, actor, &requested, display_name)
+ .await
+ }
+ EntityType::Project => {
+ self.rename_with(&*self.projects, actor, &requested, display_name)
+ .await
+ }
+ EntityType::User
+ | EntityType::Team
+ | EntityType::ChannelMessage
+ | EntityType::EmailThread
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => {
+ return unsupported(requested, "rename");
+ }
+ };
+ match result {
+ Ok(affected) => success_with_affected(requested, affected),
+ Err(error) => Err(error),
+ }
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %request.entity.entity_type, entity_id = %request.entity.entity_id))]
+ async fn move_one(
+ &self,
+ actor: &EntityMutationActor,
+ request: MoveEntityRequest,
+ ) -> EntityMutationResult {
+ let MoveEntityRequest {
+ entity: requested,
+ project_id,
+ } = request;
+ let result = match requested.entity_type {
+ EntityType::Document => {
+ self.move_with(&*self.documents, actor, &requested, project_id)
+ .await
+ }
+ EntityType::Chat => {
+ self.move_with(&*self.chats, actor, &requested, project_id)
+ .await
+ }
+ EntityType::EmailThread => {
+ self.move_with(&*self.email, actor, &requested, project_id)
+ .await
+ }
+ EntityType::Project => {
+ self.move_with(&*self.projects, actor, &requested, project_id)
+ .await
+ }
+ EntityType::User
+ | EntityType::Team
+ | EntityType::Channel
+ | EntityType::ChannelMessage
+ | EntityType::Call
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => {
+ return unsupported(requested, "move");
+ }
+ };
+ match result {
+ Ok(affected) => success_with_affected(requested, affected),
+ Err(error) => Err(error),
+ }
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %request.entity.entity_type, entity_id = %request.entity.entity_id))]
+ async fn update_share_policy_one(
+ &self,
+ actor: &EntityMutationActor,
+ request: UpdateEntitySharePolicyRequest,
+ ) -> EntityMutationResult {
+ let UpdateEntitySharePolicyRequest {
+ entity: requested,
+ policy,
+ } = request;
+ let result = match requested.entity_type {
+ EntityType::Document => {
+ self.share_with(&*self.documents, actor, &requested, policy)
+ .await
+ }
+ EntityType::Chat => {
+ self.share_with(&*self.chats, actor, &requested, policy)
+ .await
+ }
+ EntityType::Call => {
+ self.share_with(&*self.calls, actor, &requested, policy)
+ .await
+ }
+ EntityType::Project => {
+ self.share_with(&*self.projects, actor, &requested, policy)
+ .await
+ }
+ EntityType::EmailThread => self.share_email_thread(actor, &requested, policy).await,
+ // Channels grant access through participant roles and channel
+ // messages inherit from their channel; neither has a share policy.
+ EntityType::User
+ | EntityType::Team
+ | EntityType::Channel
+ | EntityType::ChannelMessage
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => {
+ return unsupported(requested, "share policy updates");
+ }
+ };
+ match result {
+ Ok(affected) => success_with_affected(requested, affected),
+ Err(error) => Err(error),
+ }
+ }
+
+ /// Email threads still update share policy through the lifecycle port.
+ async fn share_email_thread(
+ &self,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ policy: UpdateSharePermissionRequestV2,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ self.receipt::<entity_access::domain::models::OwnerAccessLevel>(actor, requested)
+ .await?;
+ self.lifecycle
+ .update_thread_share_policy(actor, requested, policy)
+ .await
+ .map_err(lifecycle_failure)
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %requested.entity_type, entity_id = %requested.entity_id))]
+ async fn trash_one(
+ &self,
+ actor: &EntityMutationActor,
+ requested: Entity<'static>,
+ ) -> EntityMutationResult {
+ let result = match requested.entity_type {
+ EntityType::Document => self.trash_with(&*self.documents, actor, &requested).await,
+ EntityType::Chat => self.trash_with(&*self.chats, actor, &requested).await,
+ EntityType::Project => self.trash_with(&*self.projects, actor, &requested).await,
+ EntityType::User
+ | EntityType::Team
+ | EntityType::Channel
+ | EntityType::ChannelMessage
+ | EntityType::EmailThread
+ | EntityType::Call
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => {
+ return unsupported(requested, "trash");
+ }
+ };
+ match result {
+ Ok(affected) => success_with_affected(requested, affected),
+ Err(error) => Err(error),
+ }
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %requested.entity_type, entity_id = %requested.entity_id))]
+ async fn restore_one(
+ &self,
+ actor: &EntityMutationActor,
+ requested: Entity<'static>,
+ ) -> EntityMutationResult {
+ let result = match requested.entity_type {
+ EntityType::Document => self.restore_document(actor, &requested).await,
+ EntityType::Chat => self.restore_with(&*self.chats, actor, &requested).await,
+ EntityType::Project => self.restore_with(&*self.projects, actor, &requested).await,
+ EntityType::User
+ | EntityType::Team
+ | EntityType::Channel
+ | EntityType::ChannelMessage
+ | EntityType::EmailThread
+ | EntityType::Call
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => {
+ return unsupported(requested, "restore");
+ }
+ };
+ match result {
+ Ok(affected) => success_with_affected(requested, affected),
+ Err(error) => Err(error),
+ }
+ }
+
+ /// Documents still restore through the lifecycle port.
+ async fn restore_document(
+ &self,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ self.receipt::<entity_access::domain::models::OwnerAccessLevel>(actor, requested)
+ .await?;
+ self.lifecycle
+ .restore_document(actor, requested)
+ .await
+ .map_err(lifecycle_failure)
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %requested.entity_type, entity_id = %requested.entity_id))]
+ async fn delete_permanently_one(
+ &self,
+ actor: &EntityMutationActor,
+ requested: Entity<'static>,
+ ) -> EntityMutationResult {
+ let result = match requested.entity_type {
+ EntityType::Document => self.delete_document_permanently(actor, &requested).await,
+ EntityType::Chat => self.delete_with(&*self.chats, actor, &requested).await,
+ EntityType::Channel => self.delete_with(&*self.channels, actor, &requested).await,
+ EntityType::Call => self.delete_with(&*self.calls, actor, &requested).await,
+ EntityType::Project => self.delete_with(&*self.projects, actor, &requested).await,
+ EntityType::User
+ | EntityType::Team
+ | EntityType::ChannelMessage
+ | EntityType::EmailThread
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => {
+ return unsupported(requested, "permanent deletion");
+ }
+ };
+ match result {
+ Ok(affected) => success_with_affected(requested, affected),
+ Err(error) => Err(error),
+ }
+ }
+
+ /// Documents still delete permanently through the lifecycle port.
+ async fn delete_document_permanently(
+ &self,
+ actor: &EntityMutationActor,
+ requested: &Entity<'static>,
+ ) -> Result<Vec<Entity<'static>>, EntityMutationErrorCode> {
+ self.receipt::<entity_access::domain::models::OwnerAccessLevel>(actor, requested)
+ .await?;
+ self.lifecycle
+ .delete_document_permanently(actor, requested)
+ .await
+ .map_err(lifecycle_failure)
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %request.entity.entity_type, entity_id = %request.entity.entity_id))]
+ async fn duplicate_one(
+ &self,
+ actor: &EntityMutationActor,
+ request: DuplicateEntityRequest,
+ ) -> EntityMutationResult {
+ let DuplicateEntityRequest {
+ entity: requested,
+ display_name,
+ } = request;
+ let result = match requested.entity_type {
+ EntityType::Document => {
+ self.duplicate_with(&*self.documents, actor, &requested, display_name)
+ .await
+ }
+ EntityType::Chat => {
+ self.duplicate_with(&*self.chats, actor, &requested, display_name)
+ .await
+ }
+ EntityType::User
+ | EntityType::Team
+ | EntityType::Channel
+ | EntityType::ChannelMessage
+ | EntityType::EmailThread
+ | EntityType::Project
+ | EntityType::Call
+ | EntityType::ForeignEntity
+ | EntityType::StaticFile
+ | EntityType::CrmCompany
+ | EntityType::CrmContact => {
+ return unsupported(requested, "duplication");
+ }
+ };
+ match result {
+ Ok(created) => Ok(EntityMutationSuccess {
+ affected_entities: vec![created],
+ }),
+ Err(error) => Err(error),
+ }
+ }
+
+ async fn set_favorite_one(
+ &self,
+ actor: &EntityMutationActor,
+ entity: &Entity<'static>,
+ favorite: bool,
+ ) -> Result<(), EntityMutationErrorCode> {
+ if favorite {
+ // The view receipt both proves visibility and carries the actor
+ // and entity for the favorites domain.
+ let receipt = self.receipt::<ViewAccessLevel>(actor, entity).await?;
+ self.favorites
+ .add_favorite(&receipt)
+ .await
+ .map_err(favorites_failure)?;
+ } else {
+ self.favorites
+ .remove_favorite_by_entity(&actor.user_id, entity)
+ .await
+ .map_err(favorites_failure)?;
+ }
+ Ok(())
+ }
+}
+
+impl<D, H, C, K, E, P, A, F, L> EntityMutationService
+ for DssEntityMutationService<D, H, C, K, E, P, A, F, L>
+where
+ D: DocumentService
+ + RenameEntity
+ + MoveEntity
+ + UpdateEntitySharePolicy
+ + TrashEntity
+ + DuplicateEntity,
+ H: ChatService
+ + RenameEntity
+ + MoveEntity
+ + UpdateEntitySharePolicy
+ + TrashEntity
+ + RestoreEntity
+ + DeleteEntityPermanently
+ + DuplicateEntity,
+ C: ChannelService + RenameEntity + DeleteEntityPermanently,
+ K: CallService + RenameEntity + UpdateEntitySharePolicy + DeleteEntityPermanently,
+ E: EmailService + MoveEntity,
+ P: ProjectService
+ + RenameEntity
+ + MoveEntity
+ + UpdateEntitySharePolicy
+ + TrashEntity
+ + RestoreEntity
+ + DeleteEntityPermanently,
+ A: EntityAccessService,
+ F: FavoritesService,
+ L: EntityLifecycleService,
+{
+ async fn rename_entities(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<RenameEntityRequest>,
+ ) -> Vec<EntityMutationResult> {
+ collect_ordered(
+ requests
+ .into_iter()
+ .map(|request| self.rename_one(&actor, request)),
+ )
+ .await
+ }
+
+ async fn move_entities(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<MoveEntityRequest>,
+ ) -> Vec<EntityMutationResult> {
+ collect_ordered(
+ requests
+ .into_iter()
+ .map(|request| self.move_one(&actor, request)),
+ )
+ .await
+ }
+
+ async fn update_share_policies(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<UpdateEntitySharePolicyRequest>,
+ ) -> Vec<EntityMutationResult> {
+ collect_ordered(
+ requests
+ .into_iter()
+ .map(|request| self.update_share_policy_one(&actor, request)),
+ )
+ .await
+ }
+
+ async fn trash_entities(
+ &self,
+ actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> Vec<EntityMutationResult> {
+ let mut futures = Vec::with_capacity(entities.len());
+ for entity in entities {
+ futures.push(self.trash_one(&actor, entity));
+ }
+ collect_ordered(futures).await
+ }
+
+ async fn restore_entities(
+ &self,
+ actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> Vec<EntityMutationResult> {
+ let mut futures = Vec::with_capacity(entities.len());
+ for entity in entities {
+ futures.push(self.restore_one(&actor, entity));
+ }
+ collect_ordered(futures).await
+ }
+
+ async fn delete_entities_permanently(
+ &self,
+ actor: EntityMutationActor,
+ entities: Vec<Entity<'static>>,
+ ) -> Vec<EntityMutationResult> {
+ let mut futures = Vec::with_capacity(entities.len());
+ for entity in entities {
+ futures.push(self.delete_permanently_one(&actor, entity));
+ }
+ collect_ordered(futures).await
+ }
+
+ async fn duplicate_entities(
+ &self,
+ actor: EntityMutationActor,
+ requests: Vec<DuplicateEntityRequest>,
+ ) -> Vec<EntityMutationResult> {
+ collect_ordered(
+ requests
+ .into_iter()
+ .map(|request| self.duplicate_one(&actor, request)),
+ )
+ .await
+ }
+
+ #[tracing::instrument(skip_all, fields(entity_type = %entity.entity_type, entity_id = %entity.entity_id))]
+ async fn set_favorite(
+ &self,
+ actor: EntityMutationActor,
+ entity: Entity<'static>,
+ favorite: bool,
+ ) -> EntityMutationResult {
+ if !favoritable(entity.entity_type) {
+ return unsupported(entity, "favorites");
+ }
+ match self.set_favorite_one(&actor, &entity, favorite).await {
+ Ok(()) => Ok(EntityMutationSuccess {
+ affected_entities: vec![entity],
+ }),
+ Err(error) => Err(error),
+ }
+ }
+}
diff --git a/services/document_storage_service/src/service/entity_mutation/test.rs b/services/document_storage_service/src/service/entity_mutation/test.rs
new file mode 100644
index 0000000000..9261d61607
--- /dev/null
+++ b/services/document_storage_service/src/service/entity_mutation/test.rs
@@ -0,0 +1,70 @@
+use super::*;
+
+#[test]
+fn success_includes_requested_entity_and_cascade_refs() {
+ let requested = EntityType::Project.with_entity_string("project-1".to_owned());
+ let child = EntityType::Document.with_entity_string("document-1".to_owned());
+
+ let success = success_with_affected(requested.clone(), vec![child.clone()])
+ .expect("mutation should succeed");
+
+ assert_eq!(success.affected_entities, vec![requested, child]);
+}
+
+#[test]
+fn lifecycle_invalid_inputs_map_to_stable_public_error() {
+ let error = lifecycle_failure(LifecycleError::InvalidInput(
+ "invalid project state".to_owned(),
+ ));
+
+ assert!(matches!(
+ error,
+ entity_mutation::EntityMutationErrorCode::InvalidInput(_)
+ ));
+}
+
+#[test]
+fn target_project_failures_map_to_stable_error_codes() {
+ let forbidden = target_project_failure(AccessError::Unauthorized);
+ assert!(matches!(
+ forbidden,
+ entity_mutation::EntityMutationErrorCode::Forbidden(_)
+ ));
+
+ let missing = target_project_failure(AccessError::NotFound("project-1"));
+ assert!(matches!(
+ missing,
+ entity_mutation::EntityMutationErrorCode::NotFound(_)
+ ));
+}
+
+#[test]
+fn favoritable_kinds_are_an_explicit_allowlist() {
+ for entity_type in [
+ EntityType::User,
+ EntityType::Team,
+ EntityType::ChannelMessage,
+ ] {
+ assert!(
+ !favoritable(entity_type),
+ "{entity_type} must not be favoritable"
+ );
+ }
+ for entity_type in [
+ EntityType::Document,
+ EntityType::Project,
+ EntityType::Chat,
+ EntityType::Channel,
+ EntityType::EmailThread,
+ EntityType::Call,
+ EntityType::ForeignEntity,
+ EntityType::StaticFile,
+ EntityType::CrmCompany,
+ EntityType::CrmContact,
+ ] {
+ assert!(
+ favoritable(entity_type),
+ "{entity_type} must be favoritable"
+ );
+ }
+}
diff --git a/services/document_storage_service/src/service/mod.rs b/services/document_storage_service/src/service/mod.rs
index e2e80f7bf1..487a973028 100644
--- a/services/document_storage_service/src/service/mod.rs
+++ b/services/document_storage_service/src/service/mod.rs
@@ -3,6 +3,7 @@ pub mod conn_gateway;
#[cfg(feature = "delete_document_worker")]
pub mod delete_document_worker;
pub mod document_search_indexer;
+pub mod entity_mutation;
pub mod property_search_indexer;
pub mod s3;
pub mod soup_favorites_reader;
diff --git a/services/notification_service/examples/send_push_notification.rs b/services/notification_service/examples/send_push_notification.rs
index 38d05cde55..80a3eb4826 100644
--- a/services/notification_service/examples/send_push_notification.rs
+++ b/services/notification_service/examples/send_push_notification.rs
@@ -27,43 +27,6 @@ async fn main() -> anyhow::Result<()> {
Ok(())
}
-fn message_attributes(collapse_key: &str) -> Option<HashMap<String, MessageAttributeValue>> {
- Some(HashMap::from([
- (
- "AWS.SNS.MOBILE.APNS.TOPIC".to_string(),
- MessageAttributeValue::builder()
- .data_type("String")
- .string_value("com.macro.app.prod") // SAFETY: this is not a secret
- .build()
- .unwrap(),
- ),
- (
- "AWS.SNS.MOBILE.APNS.PUSH_TYPE".to_string(),
- MessageAttributeValue::builder()
- .data_type("String")
- .string_value("alert")
- .build()
- .unwrap(),
- ),
- (
- "AWS.SNS.MOBILE.APNS.PRIORITY".to_string(),
- MessageAttributeValue::builder()
- .data_type("String")
- .string_value("5") // 5 is normal, 10 is high
- .build()
- .unwrap(),
- ),
- (
- "AWS.SNS.MOBILE.APNS.COLLAPSE_ID".to_string(),
- MessageAttributeValue::builder()
- .data_type("String")
- .string_value(collapse_key)
- .build()
- .unwrap(),
- ),
- ]))
-}
-
async fn send_first(
sns_client: &sns_client::SNS,
endpoint_arn: &str,
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index e1ace525b5..26e86f70ee 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -1,3 +1,130 @@
+"""
+Channel-specific entry inside the otherwise common share-policy model.
+"""
+input ChannelSharePolicyInput {
+ """
+ Requested change.
+ """
+ operation: GraphqlSharePolicyOperation!
+ """
+ Channel receiving or losing access.
+ """
+ channelId: ID!
+ """
+ Access level for add/replace operations.
+ """
+ accessLevel: GraphqlEntityAccessLevel
+}
+
+"""
+Mutation root combining property-specific and capability-oriented entity
+mutations without coupling either domain adapter to the other.
+"""
+type CompleteMutationRoot {
+ """
+ Set or attach one property on an entity.
+ """
+ setEntityProperty(input: SetEntityPropertyInput!): GraphqlProperty!
+ """
+ Rename heterogeneous entities in one request.
+ """
+ renameEntities(inputs: [RenameEntityInput!]!): EntityMutationPayload!
+ """
+ Move heterogeneous entities to a project or to the root.
+ """
+ moveEntities(inputs: [MoveEntityInput!]!): EntityMutationPayload!
+ """
+ Update public and channel share policies across supported entity kinds.
+ """
+ updateEntitySharePolicies(inputs: [UpdateEntitySharePolicyInput!]!): EntityMutationPayload!
+ """
+ Soft-delete entities with a reversible trash lifecycle.
+ """
+ trashEntities(entities: [EntityRefInput!]!): EntityMutationPayload!
+ """
+ Restore reversibly deleted entities.
+ """
+ restoreEntities(entities: [EntityRefInput!]!): EntityMutationPayload!
+ """
+ Irreversibly delete entities.
+ """
+ deleteEntitiesPermanently(entities: [EntityRefInput!]!): EntityMutationPayload!
+ """
+ Duplicate supported entities.
+ """
+ duplicateEntities(inputs: [DuplicateEntityInput!]!): EntityMutationPayload!
+ """
+ Add or remove an entity from the actor's favorites.
+ """
+ setEntityFavorite(entity: EntityRefInput!, favorite: Boolean!): GraphqlEntityMutationResult!
+}
+
+"""
+One entity duplication in a batch.
+"""
+input DuplicateEntityInput {
+ """
+ Source entity to duplicate.
+ """
+ entity: EntityRefInput!
+ """
+ Optional display name for the new entity.
+ """
+ displayName: String
+}
+
+"""
+Results for a batch mutation, preserving the input order.
+"""
+type EntityMutationPayload {
+ """
+ Per-input mutation outcomes.
+ """
+ results: [GraphqlEntityMutationResult!]!
+}
+
+"""
+Canonical entity reference accepted by unified mutations.
+"""
+input EntityRefInput {
+ """
+ Entity kind.
+ """
+ type: GraphqlEntityType!
+ """
+ Entity identifier in that kind's canonical namespace.
+ """
+ id: ID!
+}
+
+"""
+Shared public/channel share-policy update.
+"""
+input EntitySharePolicyInput {
+ """
+ Whether public access should be enabled.
+ """
+ isPublic: Boolean
+ """
+ Public access level when public access is enabled.
+ """
+ publicAccessLevel: GraphqlEntityAccessLevel
+ """
+ Channel access entries to add, remove, or replace.
+ """
+ channelSharePermissions: [ChannelSharePolicyInput!]
+}
+
+"""
+Item-style permission represented by the viewer's effective access level.
+"""
+type GraphqlAccessLevelPermission {
+ """
+ Effective access level held by the viewer.
+ """
+ accessLevel: GraphqlEntityAccessLevel!
+}
+
"""
A Boolean property value.
"""
@@ -176,6 +303,34 @@ input GraphqlChannelLiteral @oneOf {
notificationSeen: Boolean
}
+"""
+Channel role resolved for the current viewer.
+"""
+enum GraphqlChannelParticipantRole {
+ """
+ Channel owner.
+ """
+ OWNER
+ """
+ Channel administrator.
+ """
+ ADMIN
+ """
+ Channel member.
+ """
+ MEMBER
+}
+
+"""
+Channel permission represented by the viewer's participant role.
+"""
+type GraphqlChannelRolePermission {
+ """
+ Channel participant role held by the viewer.
+ """
+ role: GraphqlChannelParticipantRole!
+}
+
"""
The two operands of a recursive `ChannelThreadFilterExpr` binary expression.
"""
@@ -264,6 +419,16 @@ enum GraphqlChannelTypeFilter {
TEAM
}
+"""
+View-only channel permission without participant membership.
+"""
+type GraphqlChannelViewOnlyPermission {
+ """
+ Whether the viewer is limited to view-only channel access.
+ """
+ isViewOnly: Boolean!
+}
+
"""
The two operands of a recursive `ChatFilterExpr` binary expression.
"""
@@ -728,6 +893,42 @@ enum GraphqlEmailView {
OTHER
}
+"""
+Canonical reference to an entity.
+"""
+type GraphqlEntity {
+ """
+ The entity's canonical identifier.
+ """
+ id: ID!
+ """
+ The entity's canonical type.
+ """
+ entityType: GraphqlEntityType!
+}
+
+"""
+Item access level resolved for the current viewer.
+"""
+enum GraphqlEntityAccessLevel {
+ """
+ Read-only access.
+ """
+ VIEW
+ """
+ Comment access.
+ """
+ COMMENT
+ """
+ Edit access.
+ """
+ EDIT
+ """
+ Owner access.
+ """
+ OWNER
+}
+
"""
GraphQL input mirroring `item_filters::ast::EntityFilterAst`.
"""
@@ -774,6 +975,79 @@ input GraphqlEntityFilterAst {
propertiesFilter: GraphqlPropertiesExpr
}
+"""
+Metadata shared by every canonical Soup entity.
+"""
+type GraphqlEntityMetadata {
+ """
+ Owning user, when applicable.
+ """
+ ownerId: String
+ """
+ Parent project, channel, or team, when applicable.
+ """
+ parent: GraphqlEntity
+ """
+ Creation timestamp in RFC 3339 form.
+ """
+ createdAt: String
+ """
+ Last-update timestamp in RFC 3339 form.
+ """
+ updatedAt: String
+ """
+ Last-viewed timestamp in RFC 3339 form.
+ """
+ viewedAt: String
+ """
+ Soft-deletion timestamp in RFC 3339 form.
+ """
+ deletedAt: String
+}
+
+"""
+Stable machine-readable mutation error code.
+"""
+enum GraphqlEntityMutationErrorCode {
+ """
+ Operation is unavailable for the requested entity kind.
+ """
+ UNSUPPORTED_OPERATION
+ """
+ Input violates a domain constraint.
+ """
+ INVALID_INPUT
+ """
+ Actor lacks the required capability.
+ """
+ FORBIDDEN
+ """
+ Entity was not found.
+ """
+ NOT_FOUND
+ """
+ Mutation conflicts with current state.
+ """
+ CONFLICT
+ """
+ Internal failure.
+ """
+ INTERNAL
+}
+
+"""
+Result for one requested entity in a batch.
+"""
+union GraphqlEntityMutationResult = GraphqlMutationSuccess | GraphqlMutationError
+
+"""
+Permission held by the current viewer for an entity.
+
+The concrete union member identifies whether access comes from an item
+access level, view-only channel access, a channel role, or a team role.
+"""
+union GraphqlEntityPermission = GraphqlAccessLevelPermission | GraphqlChannelViewOnlyPermission | GraphqlChannelRolePermission | GraphqlTeamRolePermission
+
"""
Input identifying an entity referenced by a property value.
"""
@@ -802,6 +1076,64 @@ type GraphqlEntityReferencePropertyValue {
references: [GraphqlPropertyEntityReference!]!
}
+"""
+Canonical entity types accepted by cross-entity APIs.
+"""
+enum GraphqlEntityType {
+ """
+ Document entity.
+ """
+ DOCUMENT
+ """
+ Chat entity.
+ """
+ CHAT
+ """
+ Project entity.
+ """
+ PROJECT
+ """
+ Email thread entity.
+ """
+ EMAIL_THREAD
+ """
+ Channel entity.
+ """
+ CHANNEL
+ """
+ Channel message entity.
+ """
+ CHANNEL_MESSAGE
+ """
+ Call entity.
+ """
+ CALL
+ """
+ CRM company entity.
+ """
+ CRM_COMPANY
+ """
+ Foreign entity.
+ """
+ FOREIGN_ENTITY
+ """
+ User entity.
+ """
+ USER
+ """
+ Team entity.
+ """
+ TEAM
+ """
+ Static file entity.
+ """
+ STATIC_FILE
+ """
+ CRM contact entity.
+ """
+ CRM_CONTACT
+}
+
"""
The two operands of a recursive `ForeignEntityFilterExpr` binary expression.
"""
@@ -918,6 +1250,30 @@ type GraphqlLinkPropertyValue {
urls: [String!]!
}
+"""
+User-safe failure for one requested entity mutation.
+"""
+type GraphqlMutationError {
+ """
+ Stable machine-readable error category.
+ """
+ errorCode: GraphqlEntityMutationErrorCode!
+ """
+ User-safe explanation of the failure.
+ """
+ message: String!
+}
+
+"""
+Successful result for one requested entity mutation.
+"""
+type GraphqlMutationSuccess {
+ """
+ Canonical references to every entity changed by the mutation.
+ """
+ affectedEntities: [GraphqlEntity!]!
+}
+
"""
A numeric property value.
"""
@@ -1313,6 +1669,24 @@ input GraphqlSetPropertyValue @oneOf {
multiLink: [String!]
}
+"""
+Operation applied to one channel share-policy entry.
+"""
+enum GraphqlSharePolicyOperation {
+ """
+ Add an entry.
+ """
+ ADD
+ """
+ Remove an entry.
+ """
+ REMOVE
+ """
+ Replace an existing entry.
+ """
+ REPLACE
+}
+
"""
GraphQL input representing the shared email filter.
"""
@@ -1353,6 +1727,16 @@ enum GraphqlSimpleSortMethod {
VIEWED_UPDATED
}
+"""
+represents the snippet subtype fields
+"""
+type GraphqlSnippetSubType {
+ """
+ this object has nothing as a field but we need at least 1 field
+ """
+ nothing: Boolean!
+}
+
"""
GraphQL representation of a Soup group bin.
"""
@@ -1372,18 +1756,30 @@ type GraphqlSoupBin {
"""
Items in this bin, ordered by their index within the group.
"""
- items: [GraphqlSoupItem!]!
+ items: [GraphqlSoupEntity!]!
}
"""
GraphQL representation of the soup call.
"""
-type GraphqlSoupCall {
+type GraphqlSoupCall implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible call name.
+ """
+ displayName: String
+ """
+ Common call metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
The identifier of the channel.
"""
channelId: ID!
@@ -1451,6 +1847,18 @@ type GraphqlSoupCall {
Notifications associated with this entity for the authenticated user.
"""
notifications: [GraphqlSoupNotification!]!
+ """
+ Whether the authenticated viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The authenticated viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
}
"""
@@ -1474,13 +1882,25 @@ type GraphqlSoupCallParticipant {
"""
GraphQL representation of the soup channel.
"""
-type GraphqlSoupChannel {
+type GraphqlSoupChannel implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
- The name.
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible display name.
+ """
+ displayName: String
+ """
+ Common channel metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
+ The name.
"""
name: String
"""
@@ -1534,11 +1954,11 @@ type GraphqlSoupChannel {
"""
The latest message.
"""
- latestMessage: GraphqlSoupChannelMessage
+ latestMessage: GraphqlSoupChannelMessagePreview
"""
The latest non thread message.
"""
- latestNonThreadMessage: GraphqlSoupChannelMessage
+ latestNonThreadMessage: GraphqlSoupChannelMessagePreview
"""
Properties assigned to this entity that the authenticated user may view.
"""
@@ -1547,29 +1967,53 @@ type GraphqlSoupChannel {
Notifications associated with this entity for the authenticated user.
"""
notifications: [GraphqlSoupNotification!]!
+ """
+ Whether the authenticated viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The authenticated viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
}
"""
-GraphQL representation of the soup channel message.
+GraphQL representation of the soup channel thread.
"""
-type GraphqlSoupChannelMessage {
+type GraphqlSoupChannelMessage implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
- The identifier of the thread.
+ Canonical entity kind.
"""
- threadId: ID
+ entityType: GraphqlSoupEntityType!
"""
- The identifier of the sender.
+ Channel messages do not have a separate display name.
"""
- senderId: String!
+ displayName: String
"""
- The content.
+ The message content.
"""
content: String!
"""
+ Common channel-message metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
+ The identifier of the channel.
+ """
+ channelId: ID!
+ """
+ The identifier of the sender.
+ """
+ senderId: String!
+ """
The created timestamp in RFC 3339 format.
"""
createdAt: String!
@@ -1578,54 +2022,52 @@ type GraphqlSoupChannelMessage {
"""
updatedAt: String!
"""
- The deleted timestamp in RFC 3339 format.
+ The effective updated timestamp in RFC 3339 format.
"""
- deletedAt: String
+ effectiveUpdatedAt: String!
"""
- The mentions.
+ The reply count.
"""
- mentions: [String!]!
-}
-
-"""
-GraphQL representation of the soup channel participant.
-"""
-type GraphqlSoupChannelParticipant {
+ replyCount: Int!
"""
- The identifier of the channel.
+ Properties assigned to this entity that the authenticated user may view.
"""
- channelId: ID!
+ properties: [GraphqlProperty!]!
"""
- The identifier of the user.
+ Notifications associated with this entity for the authenticated user.
"""
- userId: String!
+ notifications: [GraphqlSoupNotification!]!
"""
- The role.
+ Whether the authenticated viewer has favorited this entity.
"""
- role: String!
+ isFavorited: Boolean!
"""
- The joined timestamp in RFC 3339 format.
+ The authenticated viewer's effective permission for this entity.
"""
- joinedAt: String!
+ viewerPermission: GraphqlEntityPermission
"""
- The left timestamp in RFC 3339 format.
+ The viewer's frecency score for this entity, when loaded.
"""
- leftAt: String
+ frecencyScore: Float
}
"""
-GraphQL representation of the soup channel thread.
+GraphQL representation of the soup channel message.
"""
-type GraphqlSoupChannelThread {
+type GraphqlSoupChannelMessagePreview {
"""
- The unique identifier.
+ The projected message identifier.
"""
- id: ID!
+ messageId: ID!
"""
- The identifier of the channel.
+ The parent channel identifier.
"""
channelId: ID!
"""
+ The identifier of the thread.
+ """
+ threadId: ID
+ """
The identifier of the sender.
"""
senderId: String!
@@ -1642,32 +2084,62 @@ type GraphqlSoupChannelThread {
"""
updatedAt: String!
"""
- The effective updated timestamp in RFC 3339 format.
+ The deleted timestamp in RFC 3339 format.
"""
- effectiveUpdatedAt: String!
+ deletedAt: String
"""
- The reply count.
+ The mentions.
"""
- replyCount: Int!
+ mentions: [String!]!
+}
+
+"""
+GraphQL representation of the soup channel participant.
+"""
+type GraphqlSoupChannelParticipant {
"""
- Properties assigned to this entity that the authenticated user may view.
+ The identifier of the channel.
"""
- properties: [GraphqlProperty!]!
+ channelId: ID!
"""
- Notifications associated with this entity for the authenticated user.
+ The identifier of the user.
"""
- notifications: [GraphqlSoupNotification!]!
+ userId: String!
+ """
+ The role.
+ """
+ role: String!
+ """
+ The joined timestamp in RFC 3339 format.
+ """
+ joinedAt: String!
+ """
+ The left timestamp in RFC 3339 format.
+ """
+ leftAt: String
}
"""
GraphQL representation of the soup chat.
"""
-type GraphqlSoupChat {
+type GraphqlSoupChat implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible display name.
+ """
+ displayName: String
+ """
+ Common chat metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
The name.
"""
name: String!
@@ -1707,17 +2179,41 @@ type GraphqlSoupChat {
Notifications associated with this entity for the authenticated user.
"""
notifications: [GraphqlSoupNotification!]!
+ """
+ Whether the authenticated viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The authenticated viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
}
"""
GraphQL representation of the soup crm company.
"""
-type GraphqlSoupCrmCompany {
+type GraphqlSoupCrmCompany implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible company name.
+ """
+ displayName: String
+ """
+ Common CRM-company metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
The identifier of the team.
"""
teamId: ID!
@@ -1761,17 +2257,41 @@ type GraphqlSoupCrmCompany {
Notifications associated with this entity for the authenticated user.
"""
notifications: [GraphqlSoupNotification!]!
+ """
+ Whether the authenticated viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The authenticated viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
}
"""
GraphQL representation of the soup document.
"""
-type GraphqlSoupDocument {
+type GraphqlSoupDocument implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible display name.
+ """
+ displayName: String
+ """
+ Common document metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
The name.
"""
name: String!
@@ -1815,22 +2335,25 @@ type GraphqlSoupDocument {
Notifications associated with this entity for the authenticated user.
"""
notifications: [GraphqlSoupNotification!]!
-}
-
-"""
-GraphQL representation of the soup document sub type.
-"""
-type GraphqlSoupDocumentSubType {
"""
- The kind.
+ Whether the authenticated viewer has favorited this entity.
"""
- kind: String!
+ isFavorited: Boolean!
"""
- Whether the task is completed.
+ The authenticated viewer's effective permission for this entity.
"""
- isCompleted: Boolean
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
}
+"""
+GraphQL representation of the soup document sub type.
+"""
+union GraphqlSoupDocumentSubType = GraphqlTaskSubType | GraphqlSnippetSubType
+
"""
GraphQL representation of the soup email attachment.
"""
@@ -2066,12 +2589,24 @@ type GraphqlSoupEmailParticipant {
"""
GraphQL representation of the soup email thread.
"""
-type GraphqlSoupEmailThread {
+type GraphqlSoupEmailThread implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible display name.
+ """
+ displayName: String
+ """
+ Common email-thread metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
The identifier of the provider.
"""
providerId: String
@@ -2168,15 +2703,64 @@ type GraphqlSoupEmailThread {
"""
notifications: [GraphqlSoupNotification!]!
"""
+ Whether the authenticated viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The authenticated viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
+ """
The newest non-draft content message in this thread.
"""
latestContentMessage: GraphqlSoupEmailMessage
}
"""
-GraphQL union over expanded Soup entity variants.
+Common GraphQL interface over canonical Soup entity variants.
"""
-union GraphqlSoupEntity = GraphqlSoupDocument | GraphqlSoupChat | GraphqlSoupProject | GraphqlSoupEmailThread | GraphqlSoupChannel | GraphqlSoupChannelThread | GraphqlSoupCall | GraphqlSoupCrmCompany | GraphqlSoupForeignEntity
+interface GraphqlSoupEntity {
+ """
+ The canonical entity identifier.
+ """
+ id: ID!
+ """
+ The canonical entity type.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ The user-facing entity name, when available.
+ """
+ displayName: String
+ """
+ Metadata shared across entity variants.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
+ Properties assigned to this entity that the viewer may access.
+ """
+ properties: [GraphqlProperty!]!
+ """
+ Notifications associated with this entity for the current viewer.
+ """
+ notifications: [GraphqlSoupNotification!]!
+ """
+ Whether the current viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The current viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
+}
"""
GraphQL representation of Soup entity types.
@@ -2203,9 +2787,9 @@ enum GraphqlSoupEntityType {
"""
CHANNEL
"""
- Channel thread entity.
+ Channel message entity.
"""
- CHANNEL_THREAD
+ CHANNEL_MESSAGE
"""
Call entity.
"""
@@ -2218,33 +2802,29 @@ enum GraphqlSoupEntityType {
Foreign entity.
"""
FOREIGN_ENTITY
- """
- User entity.
- """
- USER
- """
- Team entity.
- """
- TEAM
- """
- Static file entity.
- """
- STATIC_FILE
- """
- CRM contact entity.
- """
- CRM_CONTACT
}
"""
GraphQL representation of the soup foreign entity.
"""
-type GraphqlSoupForeignEntity {
+type GraphqlSoupForeignEntity implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ Foreign entities do not expose a common display name.
+ """
+ displayName: String
+ """
+ Common foreign-entity metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
The identifier of the foreign entity.
"""
foreignEntityId: String!
@@ -2261,9 +2841,9 @@ type GraphqlSoupForeignEntity {
"""
storedForAuthEntity: String!
"""
- The metadata.
+ Source-specific metadata.
"""
- metadata: JSON!
+ sourceMetadata: JSON!
"""
The created timestamp in RFC 3339 format.
"""
@@ -2280,28 +2860,18 @@ type GraphqlSoupForeignEntity {
Notifications associated with this entity for the authenticated user.
"""
notifications: [GraphqlSoupNotification!]!
-}
-
-"""
-GraphQL representation of the soup item.
-"""
-type GraphqlSoupItem {
"""
- The unique identifier.
+ Whether the authenticated viewer has favorited this entity.
"""
- id: ID!
+ isFavorited: Boolean!
"""
- The entity type.
+ The authenticated viewer's effective permission for this entity.
"""
- entityType: GraphqlSoupEntityType!
+ viewerPermission: GraphqlEntityPermission
"""
- The frecency score.
+ The viewer's frecency score for this entity, when loaded.
"""
- frecencyScore: Float!
- """
- The expanded Soup entity.
- """
- entity: GraphqlSoupEntity!
+ frecencyScore: Float
}
"""
@@ -2361,12 +2931,24 @@ type GraphqlSoupNotification {
"""
GraphQL representation of the soup project.
"""
-type GraphqlSoupProject {
+type GraphqlSoupProject implements GraphqlSoupEntity {
"""
The unique identifier.
"""
id: ID!
"""
+ Canonical entity kind.
+ """
+ entityType: GraphqlSoupEntityType!
+ """
+ User-visible display name.
+ """
+ displayName: String
+ """
+ Common project metadata.
+ """
+ metadata: GraphqlEntityMetadata!
+ """
The name.
"""
name: String!
@@ -2402,6 +2984,18 @@ type GraphqlSoupProject {
Notifications associated with this entity for the authenticated user.
"""
notifications: [GraphqlSoupNotification!]!
+ """
+ Whether the authenticated viewer has favorited this entity.
+ """
+ isFavorited: Boolean!
+ """
+ The authenticated viewer's effective permission for this entity.
+ """
+ viewerPermission: GraphqlEntityPermission
+ """
+ The viewer's frecency score for this entity, when loaded.
+ """
+ frecencyScore: Float
}
"""
@@ -2414,6 +3008,44 @@ type GraphqlStringPropertyValue {
value: String!
}
+"""
+represents the task subtype fields
+"""
+type GraphqlTaskSubType {
+ """
+ whether or not the task is complete
+ """
+ isCompleted: Boolean!
+}
+
+"""
+Team role resolved for the current viewer.
+"""
+enum GraphqlTeamRole {
+ """
+ Team owner.
+ """
+ OWNER
+ """
+ Team administrator.
+ """
+ ADMIN
+ """
+ Team member.
+ """
+ MEMBER
+}
+
+"""
+Team permission represented by the viewer's membership role.
+"""
+type GraphqlTeamRolePermission {
+ """
+ Team membership role held by the viewer.
+ """
+ role: GraphqlTeamRole!
+}
+
"""
The authenticated user and their user-scoped data.
"""
@@ -2502,13 +3134,31 @@ A scalar that can represent any JSON value.
scalar JSON
"""
-Mutations for assigning and updating entity properties.
+One entity move in a batch.
"""
-type PropertiesMutationRoot {
+input MoveEntityInput {
"""
- Set or attach one property on an entity.
+ Entity to move.
"""
- setEntityProperty(input: SetEntityPropertyInput!): GraphqlProperty!
+ entity: EntityRefInput!
+ """
+ Destination project id. Omit or pass null to move to the root.
+ """
+ projectId: ID
+}
+
+"""
+One entity rename in a batch.
+"""
+input RenameEntityInput {
+ """
+ Entity to rename.
+ """
+ entity: EntityRefInput!
+ """
+ New user-visible display name.
+ """
+ displayName: String!
}
"""
@@ -2599,7 +3249,7 @@ type SoupPage {
"""
Items in the current page.
"""
- items: [GraphqlSoupItem!]!
+ items: [GraphqlSoupEntity!]!
"""
Opaque cursor for the next page, if one exists.
"""
@@ -2627,7 +3277,21 @@ type SoupSubscriptionRoot {
"""
Subscribe to realtime Soup updates for the authenticated user.
"""
- soupUpdates: GraphqlSoupItem!
+ soupUpdates: GraphqlSoupEntity!
+}
+
+"""
+One share-policy update in a batch.
+"""
+input UpdateEntitySharePolicyInput {
+ """
+ Entity whose share policy should change.
+ """
+ entity: EntityRefInput!
+ """
+ New public/channel policy values.
+ """
+ policy: EntitySharePolicyInput!
}
"""
@@ -2644,7 +3308,7 @@ Directs the executor to skip this field or fragment when the `if` argument is tr
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
schema {
query: SoupQueryRoot
- mutation: PropertiesMutationRoot
+ mutation: CompleteMutationRoot
subscription: SoupSubscriptionRoot
}