Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(property): use graphql to fetch entity properties (#5276)
dev-rb055e27785f38
diff --git a/apps/web/src/lib/queries/properties/entity.test.tsx b/apps/web/src/lib/queries/properties/entity.test.tsxindex 20a45ea249..c3f26d470e 100644--- a/apps/web/src/lib/queries/properties/entity.test.tsx+++ b/apps/web/src/lib/queries/properties/entity.test.tsx@@ -4,55 +4,93 @@ import {QueryClient,QueryClientProvider,} from '@tanstack/solid-query';-import type { JSX } from 'solid-js';+import type { Client } from '@urql/core';+import { err, ok } from 'neverthrow';+import {+ type Accessor,+ createMemo,+ createSignal,+ type JSX,+ type Setter,+} from 'solid-js';import { render } from 'solid-js/web';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';--const setEntityPropertyMock = vi.hoisted(() => vi.fn());+import { makeSubject, onEnd, pipe } from 'wonka';+import { EntityPropertiesDocument } from '../../service-clients/service-storage/graphql/generated/graphql';+import { createUrqlQuery } from '../../urql-solid';++const useFeatureFlagMock = vi.hoisted(() => vi.fn());+const graphqlEntityPropertyMutationMock = vi.hoisted(() => vi.fn());+const createGraphqlAddEntityPropertyMutationMock = vi.hoisted(() => vi.fn());+const createGraphqlBulkSaveEntityPropertiesMutationMock = vi.hoisted(() =>+ vi.fn()+);+const buildEntityPropertiesInputMock = vi.hoisted(() => vi.fn());+const mapGraphqlEntityPropertiesMock = vi.hoisted(() => vi.fn());+const createGraphqlEntityPropertiesQueryMock = vi.hoisted(() => vi.fn());+const graphqlQueryMock = vi.hoisted(() => vi.fn());+const getRestEntityPropertiesMock = vi.hoisted(() => vi.fn());+const deleteEntityPropertyMock = vi.hoisted(() => vi.fn());+const addEntityPropertyOptionMock = vi.hoisted(() => vi.fn());+const bulkUpdateEntityPropertyOptionsMock = vi.hoisted(() => vi.fn());+const setRestEntityPropertyMock = vi.hoisted(() => vi.fn());+const isInstantiatedPropertyMock = vi.hoisted(() => vi.fn());+const entityPropertyFromApiMock = vi.hoisted(() => vi.fn());+const soupPropertyToPropertyMock = vi.hoisted(() => vi.fn());const rollbackMock = vi.hoisted(() => vi.fn());const optimisticUpdateSoupEntityMock = vi.hoisted(() => vi.fn());const invalidateSoupEntityMock = vi.hoisted(() => vi.fn());const graphqlSoupEnabledMock = vi.hoisted(() => vi.fn(() => true));const toastFailureMock = vi.hoisted(() => vi.fn());const trackMock = vi.hoisted(() => vi.fn());-const settlementCallbacks = vi.hoisted(- () =>- new Set<- (settlement: {- transactionId: string;- status: 'committed' | 'permanently-failed';- error?: string;- }) => void- >()-);vi.mock('@app/lib/analytics', () => ({analytics: { track: trackMock },}));+vi.mock('@app/lib/analytics/posthog', () => ({+ useFeatureFlag: useFeatureFlagMock,+}));+vi.mock('@core/component/Toast/Toast', () => ({toast: { failure: toastFailureMock },}));vi.mock('@core/constant/featureFlags', () => ({ENABLE_GRAPHQL_SOUP: graphqlSoupEnabledMock,+ ENABLE_GRAPHQL_SOUP_FLAG: 'enable-graphql-soup',+ ENABLE_GRAPHQL_SOUP_OVERRIDE: undefined,+}));++vi.mock('@entity/extractors-property/property-helpers', () => ({+ soupPropertyToProperty: soupPropertyToPropertyMock,}));vi.mock('@property/api/converters', () => ({- entityPropertyFromApi: vi.fn(),+ entityPropertyFromApi: entityPropertyFromApiMock,propertyValueToApi: vi.fn(() => ({ type: 'string', value: 'doing' })),}));vi.mock('@property/utils', () => ({- isInstantiatedProperty: vi.fn(() => true),+ isInstantiatedProperty: isInstantiatedPropertyMock,}));vi.mock('../../service-clients/service-properties/client', () => ({- propertiesServiceClient: {},+ propertiesServiceClient: {+ getEntityProperties: getRestEntityPropertiesMock,+ setEntityProperty: setRestEntityPropertyMock,+ deleteEntityProperty: deleteEntityPropertyMock,+ addEntityPropertyOption: addEntityPropertyOptionMock,+ bulkUpdateEntityPropertyOptions: bulkUpdateEntityPropertyOptionsMock,+ },}));-vi.mock('../../service-clients/service-storage/graphql-properties', () => ({- setEntityProperty: setEntityPropertyMock,+vi.mock('./graphql/entity', () => ({+ createGraphqlEntityPropertiesQuery: createGraphqlEntityPropertiesQueryMock,+ createGraphqlAddEntityPropertyMutation:+ createGraphqlAddEntityPropertyMutationMock,+ createGraphqlBulkSaveEntityPropertiesMutation:+ createGraphqlBulkSaveEntityPropertiesMutationMock,}));vi.mock('../client', () => ({@@ -61,22 +99,6 @@ vi.mock('../client', () => ({},}));-vi.mock('../../service-clients/service-storage/graphql-soup', () => ({- getGraphqlSoupClient: vi.fn(() => ({})),- getGraphqlCacheHost: vi.fn(() => ({- onMutationSettled: (- callback: (settlement: {- transactionId: string;- status: 'committed' | 'permanently-failed';- error?: string;- }) => void- ) => {- settlementCallbacks.add(callback);- return () => settlementCallbacks.delete(callback);- },- })),-}));-vi.mock('../soup/cache', () => ({getSoupEntityById: vi.fn(() => ({tag: 'document',@@ -98,24 +120,32 @@ vi.mock('../soup/cache', () => ({),}));-vi.mock('../soup/grouped/graphql-optimistic', () => ({- buildOptimisticGroupedPropertyUpdates: vi.fn(async () => undefined),- groupedPropertyKeys: vi.fn(() => []),-}));--vi.mock('./graphql-optimistic', () => ({- buildOptimisticSetEntityProperty: vi.fn(() => ({ id: 'assignment-1' })),-}));-import {useAddEntityPropertyMutation,+ useAddEntityPropertyOptionMutation,useBulkSaveEntityPropertiesMutation,+ useBulkUpdateEntityPropertyOptionsMutation,+ useDeleteEntityPropertyMutation,+ useEntityPropertiesQuery,} from './entity';let testQueryClient: QueryClient;let mutation: ReturnType<typeof useBulkSaveEntityPropertiesMutation>;let addMutation: ReturnType<typeof useAddEntityPropertyMutation>;+let deleteMutation: ReturnType<typeof useDeleteEntityPropertyMutation>;+let addOptionMutation: ReturnType<typeof useAddEntityPropertyOptionMutation>;+let bulkOptionsMutation: ReturnType<+ typeof useBulkUpdateEntityPropertyOptionsMutation+>;+let entityQuery: ReturnType<typeof useEntityPropertiesQuery>;let dispose: (() => void) | undefined;+let setGraphqlFlagEnabled: Setter<boolean>;+let graphqlExecutions: Array<{+ variables: unknown;+ context: unknown;+ next: (result: unknown) => void;+ ended: boolean;+}>;const property = {propertyId: 'assignment-1',@@ -137,15 +167,14 @@ const variables = {],};-function renderMutation(): void {+function renderWithQueryClient(factory: () => void): void {const container = document.createElement('div');document.body.appendChild(container);dispose = render(() => (<QueryClientProvider client={testQueryClient}>{(() => {- mutation = useBulkSaveEntityPropertiesMutation();- addMutation = useAddEntityPropertyMutation();+ factory();return null as unknown as JSX.Element;})()}</QueryClientProvider>@@ -154,150 +183,489 @@ function renderMutation(): void {);}-describe('useBulkSaveEntityPropertiesMutation dispositions', () => {+function renderMutation(): void {+ renderWithQueryClient(() => {+ mutation = useBulkSaveEntityPropertiesMutation();+ addMutation = useAddEntityPropertyMutation();+ deleteMutation = useDeleteEntityPropertyMutation();+ addOptionMutation = useAddEntityPropertyOptionMutation();+ bulkOptionsMutation = useBulkUpdateEntityPropertyOptionsMutation('task-1');+ });+}++function renderEntityQuery(+ includeMetadata: boolean,+ entityType: 'DOCUMENT' | 'USER' | Accessor<'DOCUMENT' | 'USER'> = 'DOCUMENT',+ entityId: string | Accessor<string> = 'document-1'+): void {+ const type = typeof entityType === 'function' ? entityType : () => entityType;+ const id = typeof entityId === 'function' ? entityId : () => entityId;+ renderWithQueryClient(() => {+ entityQuery = useEntityPropertiesQuery(type, id, includeMetadata);+ });+}++describe('useEntityPropertiesQuery transport', () => {beforeEach(() => {- onlineManager.setOnline(true);vi.clearAllMocks();- optimisticUpdateSoupEntityMock.mockReturnValue({ rollback: rollbackMock });graphqlSoupEnabledMock.mockReturnValue(true);- vi.spyOn(console, 'error').mockImplementation(() => undefined);- settlementCallbacks.clear();+ const [graphqlFlagEnabled, setEnabled] = createSignal(true);+ setGraphqlFlagEnabled = setEnabled;+ useFeatureFlagMock.mockReturnValue(() => ({+ enabled: graphqlFlagEnabled(),+ payload: undefined,+ }));+ graphqlExecutions = [];+ graphqlQueryMock.mockImplementation(+ (request: { variables: unknown }, context: unknown) => {+ const subject = makeSubject<unknown>();+ const execution = {+ variables: request.variables,+ context,+ next: subject.next,+ ended: false,+ };+ graphqlExecutions.push(execution);+ return pipe(+ subject.source,+ onEnd(() => {+ execution.ended = true;+ })+ );+ }+ );+ buildEntityPropertiesInputMock.mockImplementation(+ (entityType: string, entityId: string) =>+ entityType === 'USER' ? undefined : { entityType, entityId }+ );+ mapGraphqlEntityPropertiesMock.mockImplementation(+ (+ data:+ | {+ user?: {+ soup?: { items?: Array<{ id: string; properties: unknown[] }> };+ };+ }+ | undefined,+ entityId: string+ ) => {+ if (!data) return undefined;+ return (+ data.user?.soup?.items?.find((item) => item.id === entityId)+ ?.properties ?? []+ );+ }+ );+ soupPropertyToPropertyMock.mockImplementation(+ (soupProperty: { mapped: Property }) => soupProperty.mapped+ );+ createGraphqlEntityPropertiesQueryMock.mockImplementation(+ (options: {+ entityType: Accessor<string>;+ entityId: Accessor<string>;+ enabled: Accessor<boolean>;+ }) => {+ const input = createMemo(() => {+ const entityId = options.entityId();+ if (!options.enabled() || entityId.length === 0) return undefined;+ return buildEntityPropertiesInputMock(options.entityType(), entityId);+ });+ const result = createUrqlQuery(() => {+ const currentInput = input();+ const entityId = options.entityId();+ return {+ query: EntityPropertiesDocument,+ client: {+ executeQuery: graphqlQueryMock,+ } as unknown as Client,+ variables: { input: currentInput! },+ enabled: currentInput !== undefined,+ requestPolicy: 'cache-and-network' as const,+ keepPreviousData: false,+ select: (data: unknown) =>+ (+ (mapGraphqlEntityPropertiesMock(data, entityId) ??+ []) as Array<{+ mapped: Property;+ }>+ ).flatMap((property) => {+ const mapped = soupPropertyToPropertyMock(property) as Property;+ return mapped.isMetadata === true ? [] : [mapped];+ }),+ };+ });+ return {+ result,+ isEnabled: () => input() !== undefined,+ refetch: () => result.refetch({ requestPolicy: 'network-only' }),+ };+ }+ );testQueryClient = new QueryClient({- defaultOptions: {- queries: { retry: false },- mutations: { retry: false },- },+ defaultOptions: { queries: { retry: false } },});- vi.spyOn(testQueryClient, 'invalidateQueries');- renderMutation();});afterEach(() => {- onlineManager.setOnline(true);dispose?.();document.body.replaceChildren();- vi.restoreAllMocks();});- it('submits GraphQL optimism while offline for the durable cache queue', async () => {- onlineManager.setOnline(false);- setEntityPropertyMock.mockResolvedValue({- kind: 'queued',- transactionId: 'txn-offline',+ it('keeps a live GraphQL subscription for cache-pushed results', async () => {+ const nextProperty = { ...property, displayName: 'Next status' };+ renderEntityQuery(false);++ expect(entityQuery.isLoading).toBe(true);+ expect(graphqlExecutions).toHaveLength(1);+ expect(graphqlExecutions[0]).toMatchObject({+ variables: {+ input: { entityType: 'DOCUMENT', entityId: 'document-1' },+ },+ context: { requestPolicy: 'cache-and-network' },+ });+ expect(getRestEntityPropertiesMock).not.toHaveBeenCalled();++ graphqlExecutions[0]?.next({+ data: {+ user: {+ soup: {+ items: [{ id: 'document-1', properties: [{ mapped: property }] }],+ },+ },+ },+ stale: true,+ });+ await vi.waitFor(() => expect(entityQuery.data).toEqual([property]));+ expect(entityQuery.isFetching).toBe(true);++ graphqlExecutions[0]?.next({+ data: {+ user: {+ soup: {+ items: [+ { id: 'document-1', properties: [{ mapped: nextProperty }] },+ ],+ },+ },+ },+ stale: false,});+ await vi.waitFor(() => expect(entityQuery.data).toEqual([nextProperty]));+ expect(entityQuery.isFetching).toBe(false);+ expect(graphqlExecutions).toHaveLength(1);+ });- await expect(mutation.mutateAsync(variables)).resolves.toBeUndefined();+ it('reactively switches transports in both directions', async () => {+ getRestEntityPropertiesMock.mockResolvedValue(ok({ properties: [] }));+ renderEntityQuery(false);+ expect(graphqlExecutions).toHaveLength(1);+ expect(useFeatureFlagMock).toHaveBeenCalledWith('enable-graphql-soup', {+ enabledOverride: undefined,+ });- expect(setEntityPropertyMock).toHaveBeenCalledOnce();- expect(setEntityPropertyMock).toHaveBeenCalledWith(- expect.objectContaining({ optimisticProperty: { id: 'assignment-1' } })+ setGraphqlFlagEnabled(false);+ await vi.waitFor(() => expect(graphqlExecutions[0]?.ended).toBe(true));+ await vi.waitFor(() =>+ expect(getRestEntityPropertiesMock).toHaveBeenCalled());- for (const callback of settlementCallbacks) {- callback({ transactionId: 'txn-offline', status: 'committed' });- }+ setGraphqlFlagEnabled(true);+ await vi.waitFor(() => expect(graphqlExecutions).toHaveLength(2));+ expect(graphqlExecutions[1]?.ended).toBe(false);});- it('mirrors queued GraphQL optimism and defers reconciliation', async () => {- setEntityPropertyMock- .mockResolvedValueOnce({ kind: 'queued', transactionId: 'txn-1' })- .mockResolvedValueOnce({ kind: 'queued', transactionId: 'txn-2' });+ it('clears the prior entity and resubscribes when the id changes', async () => {+ const [entityId, setEntityId] = createSignal('document-1');+ renderEntityQuery(false, 'DOCUMENT', entityId);+ graphqlExecutions[0]?.next({+ data: {+ user: {+ soup: {+ items: [{ id: 'document-1', properties: [{ mapped: property }] }],+ },+ },+ },+ });+ await vi.waitFor(() => expect(entityQuery.data).toEqual([property]));- await expect(mutation.mutateAsync(variables)).resolves.toBeUndefined();- await expect(mutation.mutateAsync(variables)).resolves.toBeUndefined();+ setEntityId('document-2');- expect(optimisticUpdateSoupEntityMock).toHaveBeenCalledTimes(2);- expect(rollbackMock).not.toHaveBeenCalled();- expect(invalidateSoupEntityMock).not.toHaveBeenCalled();- expect(testQueryClient.invalidateQueries).not.toHaveBeenCalled();- expect(toastFailureMock).not.toHaveBeenCalled();- expect(setEntityPropertyMock).toHaveBeenCalledWith(- expect.objectContaining({ optimisticProperty: { id: 'assignment-1' } })- );+ expect(entityQuery.data).toBeUndefined();+ expect(entityQuery.isLoading).toBe(true);+ expect(graphqlExecutions).toHaveLength(2);+ expect(graphqlExecutions[1]?.variables).toEqual({+ input: { entityType: 'DOCUMENT', entityId: 'document-2' },+ });+ });- for (const callback of settlementCallbacks) {- callback({ transactionId: 'txn-1', status: 'committed' });- }- expect(invalidateSoupEntityMock).not.toHaveBeenCalled();+ it('pauses both transports and makes refetch a no-op for an empty id', async () => {+ renderEntityQuery(false, 'DOCUMENT', '');- for (const callback of settlementCallbacks) {- callback({ transactionId: 'txn-2', status: 'committed' });- }- expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');+ expect(entityQuery.data).toBeUndefined();+ expect(entityQuery.isLoading).toBe(false);+ await expect(entityQuery.refetch()).resolves.toBeUndefined();+ expect(graphqlExecutions).toHaveLength(0);+ expect(getRestEntityPropertiesMock).not.toHaveBeenCalled();});- it('registers each queued write before awaiting the next save', async () => {- let resolveSecond!: (disposition: {- kind: 'queued';- transactionId: string;- }) => void;- setEntityPropertyMock- .mockResolvedValueOnce({ kind: 'queued', transactionId: 'txn-race-1' })- .mockImplementationOnce(- () =>- new Promise((resolve) => {- resolveSecond = resolve;- })- );+ it('surfaces GraphQL errors and leaves the adapter out of loading', async () => {+ renderEntityQuery(false);+ const error = new Error('query failed');- const pending = mutation.mutateAsync({- properties: [variables.properties[0]!, variables.properties[0]!],+ graphqlExecutions[0]?.next({ error });++ await vi.waitFor(() => expect(entityQuery.error).toBe(error));+ expect(entityQuery.data).toBeUndefined();+ expect(entityQuery.isLoading).toBe(false);+ expect(entityQuery.isFetching).toBe(false);+ });++ it('re-fetches the live operation from the network', async () => {+ renderEntityQuery(false);++ const refetch = entityQuery.refetch();+ await vi.waitFor(() => expect(graphqlExecutions).toHaveLength(2));+ expect(graphqlExecutions[1]?.context).toMatchObject({+ requestPolicy: 'network-only',});- await vi.waitFor(() =>- expect(setEntityPropertyMock).toHaveBeenCalledTimes(2)+ graphqlExecutions[1]?.next({ data: { user: { soup: { items: [] } } } });+ await refetch;+ });++ it('keeps metadata requests on REST', async () => {+ const apiProperty = { property: { id: 'assignment-1' } };+ getRestEntityPropertiesMock.mockResolvedValue(+ ok({ properties: [apiProperty] }));+ entityPropertyFromApiMock.mockReturnValue(property);- for (const callback of settlementCallbacks) {- callback({ transactionId: 'txn-race-1', status: 'committed' });- }- expect(invalidateSoupEntityMock).not.toHaveBeenCalled();+ renderEntityQuery(true);- resolveSecond({ kind: 'queued', transactionId: 'txn-race-2' });- await pending;- expect(invalidateSoupEntityMock).not.toHaveBeenCalled();+ await vi.waitFor(() => expect(entityQuery.data).toEqual([property]));+ expect(graphqlExecutions).toHaveLength(0);+ expect(getRestEntityPropertiesMock).toHaveBeenCalledWith({+ entity_type: 'DOCUMENT',+ entity_id: 'document-1',+ query: { include_metadata: true },+ });+ });- for (const callback of settlementCallbacks) {- callback({ transactionId: 'txn-race-2', status: 'committed' });- }- expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');+ it('uses REST when the GraphQL feature is disabled', async () => {+ setGraphqlFlagEnabled(false);+ getRestEntityPropertiesMock.mockResolvedValue(ok({ properties: [] }));++ renderEntityQuery(false);++ await vi.waitFor(() => expect(entityQuery.data).toEqual([]));+ expect(graphqlExecutions).toHaveLength(0);+ expect(getRestEntityPropertiesMock).toHaveBeenCalledWith({+ entity_type: 'DOCUMENT',+ entity_id: 'document-1',+ query: { include_metadata: true },+ });+ });++ it('falls back to REST for USER properties, which Soup cannot query', async () => {+ getRestEntityPropertiesMock.mockResolvedValue(ok({ properties: [] }));++ renderEntityQuery(false, 'USER', 'user-1');++ await vi.waitFor(() => expect(entityQuery.data).toEqual([]));+ expect(graphqlExecutions).toHaveLength(0);+ expect(getRestEntityPropertiesMock).toHaveBeenCalledWith({+ entity_type: 'USER',+ entity_id: 'user-1',+ query: { include_metadata: true },+ });});+});- it('invalidates a queued write that later fails', async () => {- setEntityPropertyMock.mockResolvedValue({+describe('useBulkSaveEntityPropertiesMutation dispositions', () => {+ beforeEach(() => {+ onlineManager.setOnline(true);+ vi.clearAllMocks();+ optimisticUpdateSoupEntityMock.mockReturnValue({ rollback: rollbackMock });+ isInstantiatedPropertyMock.mockReturnValue(true);+ graphqlEntityPropertyMutationMock.mockResolvedValue({ kind: 'committed' });+ createGraphqlAddEntityPropertyMutationMock.mockImplementation(+ (options: {+ onMutate?: (input: {+ entityId: string;+ entityType: string;+ propertyDefinitionId: string;+ }) => unknown;+ onSuccess?: (input: unknown, context: unknown) => unknown;+ onError?: (error: Error, input: unknown, context: unknown) => unknown;+ onSettled?: (+ error: Error | null,+ input: unknown,+ context: unknown+ ) => unknown;+ }) => {+ let isPending = false;+ let error: Error | null = null;+ const mutateAsync = async (input: {+ entityId: string;+ entityType: string;+ propertyDefinitionId: string;+ }) => {+ isPending = true;+ const context = await options.onMutate?.(input);+ let settledError: Error | null = null;+ try {+ const disposition = await graphqlEntityPropertyMutationMock({+ kind: 'add',+ ...input,+ });+ if (disposition.kind === 'permanently-failed') {+ throw disposition.error;+ }+ await options.onSuccess?.(input, context);+ return { error: null };+ } catch (cause) {+ settledError =+ cause instanceof Error ? cause : new Error(String(cause));+ error = settledError;+ await options.onError?.(settledError, input, context);+ throw settledError;+ } finally {+ await options.onSettled?.(settledError, input, context);+ isPending = false;+ }+ };+ return {+ get isPending() {+ return isPending;+ },+ get error() {+ return error;+ },+ mutate: (input: {+ entityId: string;+ entityType: string;+ propertyDefinitionId: string;+ }) => {+ void mutateAsync(input).catch(() => undefined);+ },+ mutateAsync,+ };+ }+ );+ createGraphqlBulkSaveEntityPropertiesMutationMock.mockImplementation(+ (options: {+ onMutate?: (input: typeof variables) => unknown;+ onCommitted?: (+ item: (typeof variables)['properties'][number],+ disposition: { kind: 'committed' }+ ) => unknown;+ onSuccess?: (input: typeof variables, context: unknown) => unknown;+ onError?: (+ error: Error,+ input: typeof variables,+ context: unknown+ ) => unknown;+ onSettled?: (+ error: Error | null,+ input: typeof variables,+ context: unknown+ ) => unknown;+ }) => {+ let isPending = false;+ let error: Error | null = null;+ const mutateAsync = async (input: typeof variables) => {+ isPending = true;+ const context = await options.onMutate?.(input);+ let settledError: Error | null = null;+ try {+ for (const item of input.properties) {+ const disposition = await graphqlEntityPropertyMutationMock({+ kind: 'save',+ ...item,+ });+ if (disposition.kind === 'committed') {+ await options.onCommitted?.(item, disposition);+ } else if (disposition.kind === 'permanently-failed') {+ throw disposition.error;+ }+ }+ await options.onSuccess?.(input, context);+ return { error: null };+ } catch (cause) {+ settledError =+ cause instanceof Error ? cause : new Error(String(cause));+ error = settledError;+ await options.onError?.(settledError, input, context);+ throw settledError;+ } finally {+ await options.onSettled?.(settledError, input, context);+ isPending = false;+ }+ };+ return {+ get isPending() {+ return isPending;+ },+ get error() {+ return error;+ },+ mutate: (input: typeof variables) => {+ void mutateAsync(input).catch(() => undefined);+ },+ mutateAsync,+ };+ }+ );+ setRestEntityPropertyMock.mockResolvedValue(ok({ success: true }));+ graphqlSoupEnabledMock.mockReturnValue(true);+ deleteEntityPropertyMock.mockResolvedValue(ok(undefined));+ addEntityPropertyOptionMock.mockResolvedValue(ok(undefined));+ bulkUpdateEntityPropertyOptionsMock.mockResolvedValue(+ ok({ properties: [{ property_id: 'status-def', option_ids: ['doing'] }] })+ );+ vi.spyOn(console, 'error').mockImplementation(() => undefined);+ testQueryClient = new QueryClient({+ defaultOptions: {+ queries: { retry: false },+ mutations: { retry: false },+ },+ });+ vi.spyOn(testQueryClient, 'invalidateQueries');+ renderMutation();+ });++ afterEach(() => {+ onlineManager.setOnline(true);+ dispose?.();+ document.body.replaceChildren();+ vi.restoreAllMocks();+ });++ it('submits GraphQL optimism while offline for the durable cache queue', async () => {+ onlineManager.setOnline(false);+ graphqlEntityPropertyMutationMock.mockResolvedValue({kind: 'queued',- transactionId: 'txn-failed',+ transactionId: 'txn-offline',});- await mutation.mutateAsync(variables);- for (const callback of settlementCallbacks) {- callback({- transactionId: 'txn-failed',- status: 'permanently-failed',- error: 'invalid property',- });- }+ await expect(mutation.mutateAsync(variables)).resolves.toBeUndefined();- expect(optimisticUpdateSoupEntityMock).toHaveBeenCalledOnce();- expect(rollbackMock).not.toHaveBeenCalled();- expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');- expect(testQueryClient.invalidateQueries).toHaveBeenCalled();- expect(toastFailureMock).toHaveBeenCalledWith('Failed to save properties');+ expect(graphqlEntityPropertyMutationMock).toHaveBeenCalledOnce();+ expect(graphqlEntityPropertyMutationMock).toHaveBeenCalledWith({+ kind: 'save',+ ...variables.properties[0],+ });+ expect(optimisticUpdateSoupEntityMock).not.toHaveBeenCalled();});- it('invalidates a queued TanStack projection after commit', async () => {- setEntityPropertyMock.mockResolvedValue({+ it('treats queued GraphQL saves as accepted submissions', async () => {+ graphqlEntityPropertyMutationMock.mockResolvedValue({kind: 'queued',- transactionId: 'txn-committed',+ transactionId: 'txn-queued',});- await mutation.mutateAsync(variables);- for (const callback of settlementCallbacks) {- callback({- transactionId: 'txn-committed',- status: 'committed',- });- }+ await expect(mutation.mutateAsync(variables)).resolves.toBeUndefined();+ expect(optimisticUpdateSoupEntityMock).not.toHaveBeenCalled();expect(rollbackMock).not.toHaveBeenCalled();expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');expect(testQueryClient.invalidateQueries).toHaveBeenCalled();@@ -305,36 +673,56 @@ describe('useBulkSaveEntityPropertiesMutation dispositions', () => {});it('invalidates GraphQL permanent failures without snapshot rollback', async () => {- setEntityPropertyMock.mockResolvedValue({+ graphqlEntityPropertyMutationMock.mockResolvedValue({kind: 'permanently-failed',error: new Error('invalid property'),});await expect(mutation.mutateAsync(variables)).rejects.toThrow(- 'One or more properties permanently failed to save'+ 'invalid property');- expect(optimisticUpdateSoupEntityMock).toHaveBeenCalledOnce();+ expect(optimisticUpdateSoupEntityMock).not.toHaveBeenCalled();expect(rollbackMock).not.toHaveBeenCalled();expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');expect(testQueryClient.invalidateQueries).toHaveBeenCalled();expect(toastFailureMock).toHaveBeenCalledOnce();});+ it('exposes transport-neutral pending state', async () => {+ let resolve!: (value: { kind: 'committed' }) => void;+ graphqlEntityPropertyMutationMock.mockImplementation(+ () =>+ new Promise((resolveMutation) => {+ resolve = resolveMutation;+ })+ );++ const pending = mutation.mutateAsync(variables);+ await vi.waitFor(() => expect(mutation.isPending).toBe(true));+ await vi.waitFor(() =>+ expect(graphqlEntityPropertyMutationMock).toHaveBeenCalledOnce()+ );++ resolve({ kind: 'committed' });+ await pending;+ expect(mutation.isPending).toBe(false);+ });+it('invalidates the TanStack projection after an immediate GraphQL commit', async () => {- setEntityPropertyMock.mockResolvedValue({ kind: 'committed' });+ graphqlEntityPropertyMutationMock.mockResolvedValue({ kind: 'committed' });await mutation.mutateAsync(variables);- expect(optimisticUpdateSoupEntityMock).toHaveBeenCalledOnce();+ expect(optimisticUpdateSoupEntityMock).not.toHaveBeenCalled();expect(rollbackMock).not.toHaveBeenCalled();expect(invalidateSoupEntityMock).toHaveBeenCalledWith('task-1');expect(testQueryClient.invalidateQueries).toHaveBeenCalled();expect(toastFailureMock).not.toHaveBeenCalled();});- it('does not invalidate TanStack property queries for GraphQL attachments', async () => {- setEntityPropertyMock.mockResolvedValue({ kind: 'committed' });+ it('invalidates the REST projection for a new GraphQL attachment', async () => {+ graphqlEntityPropertyMutationMock.mockResolvedValue({ kind: 'committed' });await addMutation.mutateAsync({entityId: 'task-1',@@ -342,17 +730,101 @@ describe('useBulkSaveEntityPropertiesMutation dispositions', () => {propertyDefinitionId: 'status-def',});- expect(testQueryClient.invalidateQueries).not.toHaveBeenCalled();+ expect(graphqlEntityPropertyMutationMock).toHaveBeenCalledWith({+ kind: 'add',+ entityId: 'task-1',+ entityType: 'TASK',+ propertyDefinitionId: 'status-def',+ });+ expect(testQueryClient.invalidateQueries).toHaveBeenCalled();expect(toastFailureMock).not.toHaveBeenCalled();});- it('keeps the existing TanStack lifecycle when GraphQL Soup is disabled', async () => {- graphqlSoupEnabledMock.mockReturnValue(false);- setEntityPropertyMock.mockResolvedValue({+ it('invalidates REST projections after delete and option writes', async () => {+ await deleteMutation.mutateAsync({+ entityPropertyId: 'assignment-1',+ entityType: 'TASK',+ entityId: 'task-1',+ });+ await addOptionMutation.mutateAsync({+ entityId: 'task-1',+ entityType: 'TASK',+ property,+ optionId: 'doing',+ optimisticOptionIds: ['doing'],+ });++ expect(testQueryClient.invalidateQueries).toHaveBeenCalledTimes(2);+ });++ it('invalidates REST after a failed attachment write', async () => {+ graphqlEntityPropertyMutationMock.mockResolvedValue({kind: 'permanently-failed',- error: new Error('invalid property'),+ error: new Error('add failed'),});+ await expect(+ addMutation.mutateAsync({+ entityId: 'task-1',+ entityType: 'TASK',+ propertyDefinitionId: 'status-def',+ })+ ).rejects.toThrow('add failed');++ expect(testQueryClient.invalidateQueries).toHaveBeenCalled();+ });++ it('invalidates REST after failed REST-backed writes', async () => {+ deleteEntityPropertyMock.mockResolvedValue(+ err([{ code: 'SERVER_ERROR', message: 'delete failed' }])+ );+ await expect(+ deleteMutation.mutateAsync({+ entityPropertyId: 'assignment-1',+ entityType: 'TASK',+ entityId: 'task-1',+ })+ ).rejects.toThrow('delete failed');++ addEntityPropertyOptionMock.mockResolvedValue(+ err([{ code: 'SERVER_ERROR', message: 'option failed' }])+ );+ await expect(+ addOptionMutation.mutateAsync({+ entityId: 'task-1',+ entityType: 'TASK',+ property,+ optionId: 'doing',+ optimisticOptionIds: ['doing'],+ })+ ).rejects.toThrow('option failed');++ bulkUpdateEntityPropertyOptionsMock.mockResolvedValue(+ err([{ code: 'SERVER_ERROR', message: 'bulk failed' }])+ );+ await expect(+ bulkOptionsMutation.mutateAsync({+ entityId: 'task-1',+ entityType: 'TASK',+ properties: [+ {+ property,+ currentOptionIds: [],+ nextOptionIds: ['doing'],+ },+ ],+ })+ ).rejects.toThrow('bulk failed');++ expect(testQueryClient.invalidateQueries).toHaveBeenCalledTimes(3);+ });++ it('keeps the existing TanStack lifecycle when GraphQL Soup is disabled', async () => {+ graphqlSoupEnabledMock.mockReturnValue(false);+ setRestEntityPropertyMock.mockResolvedValue(+ err([{ code: 'SERVER_ERROR', message: 'invalid property' }])+ );+await expect(mutation.mutateAsync(variables)).rejects.toThrow('One or more properties permanently failed to save');diff --git a/apps/web/src/lib/queries/properties/entity.ts b/apps/web/src/lib/queries/properties/entity.tsindex 70f07bb7e2..f7821abca5 100644--- a/apps/web/src/lib/queries/properties/entity.ts+++ b/apps/web/src/lib/queries/properties/entity.ts@@ -1,6 +1,11 @@import { analytics } from '@app/lib/analytics';+import { useFeatureFlag } from '@app/lib/analytics/posthog';import { toast } from '@core/component/Toast/Toast';-import { ENABLE_GRAPHQL_SOUP } from '@core/constant/featureFlags';+import {+ ENABLE_GRAPHQL_SOUP,+ ENABLE_GRAPHQL_SOUP_FLAG,+ ENABLE_GRAPHQL_SOUP_OVERRIDE,+} from '@core/constant/featureFlags';import { thrownResultErrorHasCode, throwOnErr } from '@core/util/result';import {entityPropertyFromApi,@@ -20,14 +25,6 @@ import type { EntityType } from '../../service-clients/service-properties/generaimport type { PropertyTargetEntityType } from '../../service-clients/service-properties/generated/schemas/propertyTargetEntityType';import type { SoupProperty } from '../../service-clients/service-storage/generated/schemas/soupProperty';import type { SoupPropertyValue } from '../../service-clients/service-storage/generated/schemas/soupPropertyValue';-import {- type SetEntityPropertyDisposition,- setEntityProperty,-} from '../../service-clients/service-storage/graphql-properties';-import {- getGraphqlCacheHost,- getGraphqlSoupClient,-} from '../../service-clients/service-storage/graphql-soup';import { queryClient } from '../client';import {getSoupEntityById,@@ -35,12 +32,15 @@ import {optimisticUpdateSoupEntity,type SoupTransaction,} from '../soup/cache';-import {- buildOptimisticGroupedPropertyUpdates,- groupedPropertyKeys,-} from '../soup/grouped/graphql-optimistic';import { type MutationCallbacks, withCallbacks } from '../utils';-import { buildOptimisticSetEntityProperty } from './graphql-optimistic';+import {+ type AddEntityPropertyInput,+ type BulkSaveEntityPropertiesInput,+ createGraphqlAddEntityPropertyMutation,+ createGraphqlBulkSaveEntityPropertiesMutation,+ createGraphqlEntityPropertiesQuery,+ type EntityPropertyMutationDisposition,+} from './graphql/entity';import { propertiesKeys } from './keys';function toPropertyTargetEntityType(@@ -54,12 +54,52 @@ function toPropertyTargetEntityType(return entityType;}+async function setRestEntityProperty(args: {+ entityType: EntityType | PropertyTargetEntityType;+ entityId: string;+ propertyDefinitionId: string;+ value: ReturnType<typeof propertyValueToApi>;+}): Promise<EntityPropertyMutationDisposition> {+ try {+ await throwOnErr(+ async () =>+ await propertiesServiceClient.setEntityProperty({+ entity_type: toPropertyTargetEntityType(args.entityType),+ entity_id: args.entityId,+ property_id: args.propertyDefinitionId,+ body: { value: args.value },+ })+ );+ return { kind: 'committed' };+ } catch (error) {+ return {+ kind: 'permanently-failed',+ error: error instanceof Error ? error : new Error(String(error)),+ };+ }+}+export function useEntityPropertiesQuery(entityType: Accessor<EntityType>,entityId: Accessor<string>,includeMetadata: boolean) {- return useQuery(+ const graphqlSoupFlag = useFeatureFlag(ENABLE_GRAPHQL_SOUP_FLAG, {+ enabledOverride: ENABLE_GRAPHQL_SOUP_OVERRIDE,+ });++ // Metadata properties are computed by the REST properties endpoint and are+ // not part of the GraphQL Soup property edge. USER is not represented in+ // Soup either. The GraphQL adapter owns those eligibility details.+ const graphqlQuery = createGraphqlEntityPropertiesQuery({+ entityType,+ entityId,+ enabled: () => graphqlSoupFlag().enabled && !includeMetadata,+ });++ const usesGraphql = graphqlQuery.isEnabled;++ const restQuery = useQuery(() => {const type = entityType();const id = entityId();@@ -68,6 +108,7 @@ export function useEntityPropertiesQuery(entityType: type,entityId: id,}).queryKey,+ enabled: !usesGraphql() && id.length > 0,queryFn: async () => {// Always fetch with metadata so consumers with different// `includeMetadata` values share one cache entry and one request.@@ -97,6 +138,29 @@ export function useEntityPropertiesQuery(},() => queryClient);++ return {+ get data() {+ return usesGraphql() ? graphqlQuery.result.data : restQuery.data;+ },+ get error() {+ return usesGraphql() ? graphqlQuery.result.error : restQuery.error;+ },+ get isLoading() {+ return usesGraphql()+ ? graphqlQuery.result.isLoading+ : restQuery.isLoading;+ },+ get isFetching() {+ return usesGraphql()+ ? graphqlQuery.result.isFetching+ : restQuery.isFetching;+ },+ refetch() {+ if (entityId().length === 0) return Promise.resolve(undefined);+ return usesGraphql() ? graphqlQuery.refetch() : restQuery.refetch();+ },+ };}function invalidatePropertiesForEntity(@@ -269,12 +333,15 @@ export function useDeleteEntityPropertyMutation(},...withCallbacks<void, Error, DeleteEntityPropertyParams>({- onError(error) {+ onSuccess: (_data, variables) =>+ invalidatePropertiesForEntity(+ variables.entityType,+ variables.entityId+ ),+ onError(error, variables) {console.error('Failed to delete property', error);toast.failure('Failed to delete property');- },- onSettled: (_data, _error, variables) => {- invalidatePropertiesForEntity(+ return invalidatePropertiesForEntity(variables.entityType,variables.entityId);@@ -285,48 +352,34 @@ export function useDeleteEntityPropertyMutation(}));}-type AddEntityPropertyParams = {- entityId: string;- entityType: EntityType | PropertyTargetEntityType;- propertyDefinitionId: string;-};+type AddEntityPropertyParams = AddEntityPropertyInput;-/** Adds property without initial value - user sets it later */-export function useAddEntityPropertyMutation(+function useRestAddEntityPropertyMutation(callbacks?: MutationCallbacks<void, Error, AddEntityPropertyParams>) {return useMutation(() => ({mutationFn: async (vars: AddEntityPropertyParams) => {- // New attachments have no assignment id until the server responds, so- // this write is never optimistic.- try {- const disposition = await setEntityProperty({- entityType: toPropertyTargetEntityType(vars.entityType),- entityId: vars.entityId,- propertyDefinitionId: vars.propertyDefinitionId,- value: null,- });- if (disposition.kind === 'permanently-failed') {- throw disposition.error;- }- } catch (error) {- if (ENABLE_GRAPHQL_SOUP()) {- console.error('Failed to add property', error);- toast.failure('Failed to add property');- }- throw error;+ const disposition = await setRestEntityProperty({+ entityType: vars.entityType,+ entityId: vars.entityId,+ propertyDefinitionId: vars.propertyDefinitionId,+ value: null,+ });+ if (disposition.kind === 'permanently-failed') {+ throw disposition.error;}},...withCallbacks<void, Error, AddEntityPropertyParams>({- onError(error) {- if (ENABLE_GRAPHQL_SOUP()) return;+ onSuccess: (_data, variables) =>+ invalidatePropertiesForEntity(+ variables.entityType,+ variables.entityId+ ),+ onError(error, variables) {console.error('Failed to add property', error);toast.failure('Failed to add property');- },- onSettled: (_data, _error, variables) => {- if (ENABLE_GRAPHQL_SOUP()) return;- invalidatePropertiesForEntity(+ return invalidatePropertiesForEntity(variables.entityType,variables.entityId);@@ -337,6 +390,83 @@ export function useAddEntityPropertyMutation(}));}+/** Transport-neutral mutation interface for property attachments. */+export type AddEntityPropertyMutation = {+ readonly isPending: boolean;+ readonly error: Error | null;+ mutate(variables: AddEntityPropertyParams): void;+ mutateAsync(variables: AddEntityPropertyParams): Promise<void>;+};++/** Adds a property through GraphQL or the REST fallback. */+export function useAddEntityPropertyMutation(+ callbacks?: MutationCallbacks<void, Error, AddEntityPropertyParams>+): AddEntityPropertyMutation {+ const restMutation = useRestAddEntityPropertyMutation(callbacks);+ const graphqlMutation = createGraphqlAddEntityPropertyMutation<unknown>({+ onMutate: (variables) =>+ callbacks?.onMutate?.(variables, undefined as never),+ onSuccess: async (variables, context) => {+ await invalidatePropertiesForEntity(+ variables.entityType,+ variables.entityId+ );+ await callbacks?.onSuccess?.(+ undefined,+ variables,+ context,+ undefined as never+ );+ },+ onError: async (error, variables, context) => {+ console.error('Failed to add property', error);+ toast.failure('Failed to add property');+ await invalidatePropertiesForEntity(+ variables.entityType,+ variables.entityId+ );+ await callbacks?.onError?.(error, variables, context, undefined as never);+ },+ onSettled: async (error, variables, context) => {+ await callbacks?.onSettled?.(+ undefined,+ error,+ variables,+ context,+ undefined as never+ );+ },+ });++ return {+ get isPending() {+ return ENABLE_GRAPHQL_SOUP()+ ? graphqlMutation.isPending+ : restMutation.isPending;+ },+ get error() {+ return ENABLE_GRAPHQL_SOUP()+ ? graphqlMutation.error+ : (restMutation.error ?? null);+ },+ mutate(variables) {+ if (ENABLE_GRAPHQL_SOUP()) {+ graphqlMutation.mutate(variables);+ } else {+ restMutation.mutate(variables);+ }+ },+ async mutateAsync(variables) {+ if (ENABLE_GRAPHQL_SOUP()) {+ const result = await graphqlMutation.mutateAsync(variables);+ if (result.error) throw result.error;+ } else {+ await restMutation.mutateAsync(variables);+ }+ },+ };+}+type EntityPropertyOptionParams = {entityId: string;entityType: EntityType | PropertyTargetEntityType;@@ -382,14 +512,22 @@ function entityPropertyOptionCallbacks();return { soupTxn };},- onError: (error, _vars, context) => {+ onSuccess: (_data, variables) => {+ invalidateSoupEntity(variables.entityId);+ return invalidatePropertiesForEntity(+ variables.entityType,+ variables.entityId+ );+ },+ onError: (error, variables, context) => {context?.soupTxn?.rollback();+ invalidateSoupEntity(variables.entityId);console.error(failureMessage, error);toast.failure(failureMessage);- },- onSettled: (_data, _error, variables) => {- invalidatePropertiesForEntity(variables.entityType, variables.entityId);- invalidateSoupEntity(variables.entityId);+ return invalidatePropertiesForEntity(+ variables.entityType,+ variables.entityId+ );},},callbacks@@ -638,21 +776,21 @@ export function useBulkUpdateEntityPropertyOptionsMutation(];}));+ invalidateSoupEntity(variables.entityId);+ return invalidatePropertiesForEntity(+ variables.entityType,+ variables.entityId+ );},- onError: (error, _variables, context) => {+ onError: (error, variables, context) => {context?.soupTxn?.rollback();+ invalidateSoupEntity(variables.entityId);console.error('Failed to update tags', error);toast.failure(thrownResultErrorHasCode(error, 'FORBIDDEN')? 'Edit permissions are required to update tags': 'Failed to update tags');- },- onSettled: (_data, _error, variables) => {- invalidateSoupEntity(variables.entityId);- // Returned so the mutation stays `pending` until the refetch lands,- // keeping the in-flight optimistic overlay visible through the- // reconcile with no flash back to the stale value.return invalidatePropertiesForEntity(variables.entityType,variables.entityId@@ -719,24 +857,16 @@ function trackTaskPropertySave(});}-type BulkSaveEntityPropertiesParams = {- properties: Array<{- entityId: string;- entityType: EntityType | PropertyTargetEntityType;- property: Property | PropertyDefinitionDomain;- apiValues: PropertyApiValues;- }>;-};+type BulkSaveEntityPropertiesParams = BulkSaveEntityPropertiesInput;type BulkSaveEntityPropertiesContext = {- usesGraphqlSoup: boolean;/** Index-aligned with `variables.properties`. */soupTxns: Array<SoupTransaction | undefined>;};type BulkSaveEntityPropertiesResult = {/** Index-aligned with the submitted properties. */- dispositions: SetEntityPropertyDisposition[];+ dispositions: EntityPropertyMutationDisposition[];};class BulkSaveEntityPropertiesError extends Error {@@ -746,99 +876,24 @@ class BulkSaveEntityPropertiesError extends Error {}}-type QueuedPropertySave = {- item: BulkSaveEntityPropertiesParams['properties'][number];-};-const queuedPropertySaves = new Map<string, QueuedPropertySave>();-const activeGraphqlPropertySaveCounts = new Map<string, number>();-let settlementHost:- | NonNullable<ReturnType<typeof getGraphqlCacheHost>>- | undefined;-let unsubscribeSettlements: (() => void) | undefined;--function ensurePropertySettlementListener(): void {- const host = getGraphqlCacheHost();- if (!host || host === settlementHost) return;-- unsubscribeSettlements?.();- settlementHost = host;- unsubscribeSettlements = host.onMutationSettled((settlement) => {- const queued = queuedPropertySaves.get(settlement.transactionId);- if (!queued) return;- queuedPropertySaves.delete(settlement.transactionId);-- const { item } = queued;- if (settlement.status === 'committed') {- trackTaskPropertySave(- item.entityId,- getPropertyDefinitionId(item.property),- item.apiValues- );- reconcilePropertySaveCaches(item);- return;- }-- // A SoupTransaction restores a whole cache snapshot, so it is unsafe to- // roll one back after a durable write has spent time in the queue. Refetch- // once all queued projections for this entity have settled instead.- reconcilePropertySaveCaches(item);- const error = new Error(settlement.error);- console.error('Queued property save permanently failed', error);- toast.failure('Failed to save properties');- });-}-function invalidatePropertySaveCaches(item: BulkSaveEntityPropertiesParams['properties'][number]): void {- invalidatePropertiesForEntity(item.entityType, item.entityId);+ void invalidatePropertiesForEntity(item.entityType, item.entityId);invalidateSoupEntity(item.entityId);}-function reconcilePropertySaveCaches(- item: BulkSaveEntityPropertiesParams['properties'][number]-): void {- const hasQueuedSave = [...queuedPropertySaves.values()].some(- (queued) => queued.item.entityId === item.entityId- );- const hasActiveSave =- (activeGraphqlPropertySaveCounts.get(item.entityId) ?? 0) > 0;- if (!hasQueuedSave && !hasActiveSave) invalidatePropertySaveCaches(item);-}--function trackActiveGraphqlPropertySaves(- variables: BulkSaveEntityPropertiesParams-): void {- for (const item of variables.properties) {- const count = activeGraphqlPropertySaveCounts.get(item.entityId) ?? 0;- activeGraphqlPropertySaveCounts.set(item.entityId, count + 1);- }-}--function untrackActiveGraphqlPropertySaves(- variables: BulkSaveEntityPropertiesParams-): void {- for (const item of variables.properties) {- const count = activeGraphqlPropertySaveCounts.get(item.entityId) ?? 0;- if (count <= 1) activeGraphqlPropertySaveCounts.delete(item.entityId);- else activeGraphqlPropertySaveCounts.set(item.entityId, count - 1);- }-}--function handleAcceptedPropertySave(+function handleCommittedPropertySave(item: BulkSaveEntityPropertiesParams['properties'][number],- disposition: SetEntityPropertyDisposition+ disposition: EntityPropertyMutationDisposition): void {- if (disposition.kind === 'committed') {- trackTaskPropertySave(- item.entityId,- getPropertyDefinitionId(item.property),- item.apiValues- );- } else if (disposition.kind === 'queued') {- queuedPropertySaves.set(disposition.transactionId, { item });- ensurePropertySettlementListener();- }+ if (disposition.kind !== 'committed') return;++ trackTaskPropertySave(+ item.entityId,+ getPropertyDefinitionId(item.property),+ item.apiValues+ );}function reportBulkPropertySaveFailure(error: Error): void {@@ -857,8 +912,7 @@ function rollbackBulkSoupTransactions(});}-/** Saves multiple entity properties, durably queueing GraphQL writes. */-export function useBulkSaveEntityPropertiesMutation(+function useRestBulkSaveEntityPropertiesMutation(callbacks?: MutationCallbacks<void,Error,@@ -867,78 +921,22 @@ export function useBulkSaveEntityPropertiesMutation(>) {return useMutation(() => ({- // The normalized GraphQL cache owns its durable offline queue. TanStack's- // default `online` mode would pause before `mutationFn`, preventing the- // optimistic layer from ever reaching the SharedWorker.- networkMode: ENABLE_GRAPHQL_SOUP() ? 'always' : 'online',mutationFn: async (vars: BulkSaveEntityPropertiesParams): Promise<void> => {- const usesGraphqlSoup = ENABLE_GRAPHQL_SOUP();- const save = async (- item: BulkSaveEntityPropertiesParams['properties'][number]- ) => {- const propertyValue = propertyValueToApi(- item.apiValues,- item.property.isMultiSelect- );- const optimisticProperty = buildOptimisticSetEntityProperty(- item.property,- item.apiValues- );- let optimisticCache;-- if (usesGraphqlSoup && isInstantiatedProperty(item.property)) {- // Client construction owns host selection; force it before asking- // for the host used by inspect-driven relation discovery.- getGraphqlSoupClient();- const host = getGraphqlCacheHost();- if (host) {- try {- const oldGroupKeys = groupedPropertyKeys(item.property);- const newGroupKeys = groupedPropertyKeys(item.apiValues);- optimisticCache = await buildOptimisticGroupedPropertyUpdates({- host,- entityId: item.entityId,- propertyDefinitionId: item.property.propertyDefinitionId,- oldGroupKeys: oldGroupKeys ?? [],- newGroupKeys: newGroupKeys ?? [],- revalidateOnly:- oldGroupKeys === undefined || newGroupKeys === undefined,- });- } catch (error) {- // Relation discovery is an optimization. Property writes still- // proceed with normalized entity optimism when cache inspection- // is unavailable.- console.warn('Failed to build grouped Soup optimism', error);- }- }- }-- const disposition = await setEntityProperty({- entityType: toPropertyTargetEntityType(item.entityType),- entityId: item.entityId,- propertyDefinitionId: getPropertyDefinitionId(item.property),- value: propertyValue,- optimisticProperty,- optimisticCache,- });- // Register durable writes before the sequential GraphQL loop awaits the- // next item; settlement events are one-shot and are not replayed.- handleAcceptedPropertySave(item, disposition);- return disposition;- };-- let dispositions: SetEntityPropertyDisposition[];- if (usesGraphqlSoup) {- // Begin each durable layer sequentially so later relation recipes see- // the effective result of earlier property edits.- dispositions = [];- for (const item of vars.properties) {- dispositions.push(await save(item));- }- } else {- dispositions = await Promise.all(vars.properties.map(save));- }-+ const dispositions = await Promise.all(+ vars.properties.map(async (item) => {+ const disposition = await setRestEntityProperty({+ entityType: item.entityType,+ entityId: item.entityId,+ propertyDefinitionId: getPropertyDefinitionId(item.property),+ value: propertyValueToApi(+ item.apiValues,+ item.property.isMultiSelect+ ),+ });+ handleCommittedPropertySave(item, disposition);+ return disposition;+ })+ );const result = { dispositions };if (dispositions.some(@@ -957,11 +955,8 @@ export function useBulkSaveEntityPropertiesMutation({onMutate: (vars: BulkSaveEntityPropertiesParams- ): BulkSaveEntityPropertiesContext => {- const usesGraphqlSoup = ENABLE_GRAPHQL_SOUP();- // Keep any populated TanStack Soup projection in sync even when- // GraphQL owns transport and normalized-cache optimism.- const soupTxns = batch(() =>+ ): BulkSaveEntityPropertiesContext => ({+ soupTxns: batch(() =>vars.properties.map((item) =>optimisticUpdateSoupEntityProperty(item.entityId,@@ -969,26 +964,16 @@ export function useBulkSaveEntityPropertiesMutation(apiValuesToSoupPropertyValue(item.apiValues)))- );- if (usesGraphqlSoup) trackActiveGraphqlPropertySaves(vars);- return { usesGraphqlSoup, soupTxns };- },+ ),+ }),onError: (error, _variables, context) => {- // REST errors settle immediately, so preserve its existing rollback.- // GraphQL writes may settle much later; restoring their captured- // snapshots could erase newer Soup updates, so refetch instead.- if (!context?.usesGraphqlSoup) rollbackBulkSoupTransactions(context);+ rollbackBulkSoupTransactions(context);reportBulkPropertySaveFailure(error);},- onSettled: (_data, _error, variables, context) => {- if (context?.usesGraphqlSoup)- untrackActiveGraphqlPropertySaves(variables);+ onSettled: (_data, _error, variables) => {batch(() => {- const reconciledEntityIds = new Set<string>();for (const item of variables.properties) {- if (reconciledEntityIds.has(item.entityId)) continue;- reconciledEntityIds.add(item.entityId);- reconcilePropertySaveCaches(item);+ invalidatePropertySaveCaches(item);}});},@@ -997,3 +982,92 @@ export function useBulkSaveEntityPropertiesMutation(),}));}++/** Transport-neutral mutation interface exposed to property consumers. */+export type BulkSaveEntityPropertiesMutation = {+ readonly isPending: boolean;+ readonly error: Error | null;+ mutate(variables: BulkSaveEntityPropertiesParams): void;+ mutateAsync(variables: BulkSaveEntityPropertiesParams): Promise<void>;+};++/** Saves entity properties through GraphQL or the REST fallback. */+export function useBulkSaveEntityPropertiesMutation(+ callbacks?: MutationCallbacks<+ void,+ Error,+ BulkSaveEntityPropertiesParams,+ BulkSaveEntityPropertiesContext+ >+): BulkSaveEntityPropertiesMutation {+ const restMutation = useRestBulkSaveEntityPropertiesMutation(callbacks);+ const graphqlMutation =+ createGraphqlBulkSaveEntityPropertiesMutation<BulkSaveEntityPropertiesContext>(+ {+ onMutate: async (variables) =>+ (await callbacks?.onMutate?.(variables, undefined as never)) ?? {+ soupTxns: [],+ },+ onCommitted: handleCommittedPropertySave,+ onSuccess: async (variables, context) => {+ await callbacks?.onSuccess?.(+ undefined,+ variables,+ context ?? { soupTxns: [] },+ undefined as never+ );+ },+ onError: async (error, variables, context) => {+ reportBulkPropertySaveFailure(error);+ await callbacks?.onError?.(+ error,+ variables,+ context ?? { soupTxns: [] },+ undefined as never+ );+ },+ onSettled: async (error, variables, context) => {+ batch(() => {+ for (const item of variables.properties) {+ invalidatePropertySaveCaches(item);+ }+ });+ await callbacks?.onSettled?.(+ undefined,+ error,+ variables,+ context ?? { soupTxns: [] },+ undefined as never+ );+ },+ }+ );++ return {+ get isPending() {+ return ENABLE_GRAPHQL_SOUP()+ ? graphqlMutation.isPending+ : restMutation.isPending;+ },+ get error() {+ return ENABLE_GRAPHQL_SOUP()+ ? graphqlMutation.error+ : (restMutation.error ?? null);+ },+ mutate(variables) {+ if (ENABLE_GRAPHQL_SOUP()) {+ graphqlMutation.mutate(variables);+ } else {+ restMutation.mutate(variables);+ }+ },+ async mutateAsync(variables) {+ if (ENABLE_GRAPHQL_SOUP()) {+ const result = await graphqlMutation.mutateAsync(variables);+ if (result.error) throw result.error;+ } else {+ await restMutation.mutateAsync(variables);+ }+ },+ };+}diff --git a/apps/web/src/lib/queries/properties/graphql/entity.test.ts b/apps/web/src/lib/queries/properties/graphql/entity.test.tsnew file mode 100644index 0000000000..71d0f68748--- /dev/null+++ b/apps/web/src/lib/queries/properties/graphql/entity.test.ts@@ -0,0 +1,446 @@+import type { Property } from '@property/types';+import type { EntityType } from '@service-properties/generated/schemas/entityType';+import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';+import {+ type Client,+ createClient,+ type Exchange,+ type Operation,+ type OperationResult,+} from '@urql/core';+import { createRoot, createSignal } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { filter, makeSubject, mergeMap, pipe } from 'wonka';++const graphqlClientState = vi.hoisted(() => ({+ current: undefined as Client | undefined,+}));+const mapGraphqlPropertiesMock = vi.hoisted(() => vi.fn());++vi.mock('@service-storage/graphql-soup', () => ({+ getGraphqlSoupClient: () => {+ if (!graphqlClientState.current) throw new Error('GraphQL client not set');+ return graphqlClientState.current;+ },+ getGraphqlCacheHost: () => undefined,+ mapGraphqlProperties: mapGraphqlPropertiesMock,+}));++import {+ buildEntityPropertiesInput,+ createGraphqlAddEntityPropertyMutation,+ createGraphqlBulkSaveEntityPropertiesMutation,+ createGraphqlEntityPropertiesQuery,+ mapGraphqlEntityProperties,+} from './entity';++const NIL_ENTITY_ID = '00000000-0000-0000-0000-000000000000';++type ControlledRequest = {+ operation: Operation;+ next: (result?: Pick<OperationResult, 'data' | 'error'>) => void;+};++function makeControlledClient() {+ const requests: ControlledRequest[] = [];+ const exchange: Exchange = () => (operations$) =>+ pipe(+ operations$,+ filter((operation) => operation.kind === 'query'),+ mergeMap((operation) => {+ const subject = makeSubject<OperationResult>();+ requests.push({+ operation,+ next: (result = {}) =>+ subject.next({+ operation,+ data: result.data,+ error: result.error,+ stale: false,+ hasNext: false,+ }),+ });+ return subject.source;+ })+ );+ const client = createClient({+ url: 'https://example.test/graphql',+ exchanges: [exchange],+ });+ graphqlClientState.current = client;+ return { client, requests };+}++const EMPTY_DATA = {+ user: { id: 'user-1', soup: { items: [] } },+};+const NIL_FILTERS = {+ calendarEventFilter: { literal: { id: NIL_ENTITY_ID } },+ documentFilter: { literal: { id: NIL_ENTITY_ID } },+ projectFilter: { literal: { projectIdSelf: NIL_ENTITY_ID } },+ chatFilter: { literal: { chatId: NIL_ENTITY_ID } },+ emailFilter: { tree: { literal: { threadId: NIL_ENTITY_ID } } },+ channelFilter: { literal: { channelId: NIL_ENTITY_ID } },+ channelThreadFilter: { literal: { threadId: NIL_ENTITY_ID } },+ callFilter: { literal: { callId: NIL_ENTITY_ID } },+ crmCompanyFilter: { literal: { id: NIL_ENTITY_ID } },+ foreignEntityFilter: { literal: { id: NIL_ENTITY_ID } },+};++function initialInput(entityType: EntityType) {+ const input = buildEntityPropertiesInput(entityType, 'entity-1');+ if (!input || !('initial' in input) || !input.initial) {+ throw new Error(`Expected an initial Soup input for ${entityType}`);+ }+ return input.initial;+}++describe('buildEntityPropertiesInput', () => {+ it.each([+ ['DOCUMENT', 'documentFilter', { literal: { id: 'entity-1' } }],+ ['TASK', 'documentFilter', { literal: { id: 'entity-1' } }],+ ['PROJECT', 'projectFilter', { literal: { projectIdSelf: 'entity-1' } }],+ ['CHAT', 'chatFilter', { literal: { chatId: 'entity-1' } }],+ ['THREAD', 'emailFilter', { tree: { literal: { threadId: 'entity-1' } } }],+ ['CHANNEL', 'channelFilter', { literal: { channelId: 'entity-1' } }],+ ['CALL_RECORD', 'callFilter', { literal: { callId: 'entity-1' } }],+ ['COMPANY', 'crmCompanyFilter', { literal: { id: 'entity-1' } }],+ ['CALENDAR_EVENT', 'calendarEventFilter', { literal: { id: 'entity-1' } }],+ ] as const)(+ 'targets one %s and excludes the other Soup branches',+ (entityType, filterKey, expectedFilter) => {+ const input = initialInput(entityType);++ expect(input).toMatchObject({+ limit: 1,+ expand: true,+ sortMethod: 'UPDATED_AT',+ emailView: 'ALL',+ });+ expect(input.filters).toEqual({+ ...NIL_FILTERS,+ [filterKey]: expectedFilter,+ });+ }+ );++ it('returns undefined for USER because users are not represented in Soup', () => {+ expect(buildEntityPropertiesInput('USER', 'user-1')).toBeUndefined();+ });+});++describe('mapGraphqlEntityProperties', () => {+ beforeEach(() => {+ vi.clearAllMocks();+ });++ it('maps only the requested entity properties', () => {+ const property = { id: 'property-1' };+ const mapped = [{ id: 'property-1' }] as SoupProperty[];+ mapGraphqlPropertiesMock.mockReturnValue(mapped);++ expect(+ mapGraphqlEntityProperties(+ {+ user: {+ id: 'user-1',+ soup: {+ items: [+ {+ __typename: 'GraphqlSoupDocument',+ id: 'other-entity',+ properties: [],+ },+ {+ __typename: 'GraphqlSoupDocument',+ id: 'entity-1',+ properties: [property],+ },+ ],+ },+ },+ } as never,+ 'entity-1'+ )+ ).toBe(mapped);+ expect(mapGraphqlPropertiesMock).toHaveBeenCalledWith([property]);+ });++ it('retains the not-yet-loaded distinction', () => {+ expect(mapGraphqlEntityProperties(undefined, 'entity-1')).toBeUndefined();+ expect(mapGraphqlPropertiesMock).not.toHaveBeenCalled();+ });+});++describe('GraphQL entity property mutations', () => {+ let dispose: (() => void) | undefined;++ afterEach(() => dispose?.());++ it('executes add mutations through the urql-solid adapter', async () => {+ const property = { id: 'property-1' };+ const mutation = vi.fn(+ (+ _document: unknown,+ _variables: unknown,+ context: Record<string, unknown>+ ) => ({+ toPromise: async () => ({+ operation: {+ kind: 'mutation',+ context,+ } as Operation,+ data: { setEntityProperty: property },+ stale: false,+ hasNext: false,+ }),+ })+ );+ graphqlClientState.current = { mutation } as unknown as Client;+ let result!: ReturnType<typeof createGraphqlAddEntityPropertyMutation>;++ createRoot((rootDispose) => {+ dispose = rootDispose;+ result = createGraphqlAddEntityPropertyMutation();+ });++ await expect(+ result.mutateAsync({+ entityType: 'TASK',+ entityId: 'task-1',+ propertyDefinitionId: 'definition-1',+ })+ ).resolves.toMatchObject({+ data: { setEntityProperty: property },+ });+ expect(mutation).toHaveBeenCalledWith(+ expect.anything(),+ {+ input: {+ entityType: 'DOCUMENT',+ entityId: 'task-1',+ propertyDefinitionId: 'definition-1',+ value: null,+ },+ },+ {}+ );+ });++ it('durably queues optimistic saves', async () => {+ const property = {+ propertyId: 'assignment-1',+ propertyDefinitionId: 'definition-1',+ displayName: 'Status',+ valueType: 'STRING',+ isMultiSelect: false,+ isSystemProperty: false,+ isMetadata: false,+ } as Property;+ const mutation = vi.fn(+ (+ _document: unknown,+ _variables: unknown,+ context: Record<string, unknown>+ ) => ({+ toPromise: async () => ({+ operation: {+ kind: 'mutation',+ context,+ } as Operation,+ data: { setEntityProperty: { id: 'assignment-1' } },+ extensions: {+ normalizedCacheMutationDisposition: {+ kind: 'queued',+ transactionId: 'transaction-1',+ },+ },+ stale: false,+ hasNext: false,+ }),+ })+ );+ graphqlClientState.current = { mutation } as unknown as Client;+ let result!: ReturnType<+ typeof createGraphqlBulkSaveEntityPropertiesMutation+ >;++ createRoot((rootDispose) => {+ dispose = rootDispose;+ result = createGraphqlBulkSaveEntityPropertiesMutation();+ });++ await expect(+ result.mutateAsync({+ properties: [+ {+ entityType: 'DOCUMENT',+ entityId: 'document-1',+ property,+ apiValues: { valueType: 'STRING', value: 'doing' },+ },+ ],+ })+ ).resolves.toMatchObject({+ extensions: {+ normalizedCacheMutationDisposition: {+ kind: 'queued',+ transactionId: 'transaction-1',+ },+ },+ });+ expect(mutation).toHaveBeenCalledWith(+ expect.anything(),+ {+ input: {+ entityType: 'DOCUMENT',+ entityId: 'document-1',+ propertyDefinitionId: 'definition-1',+ value: { string: 'doing' },+ },+ },+ expect.objectContaining({+ normalizedCacheOptimistic: expect.objectContaining({+ optimisticResponse: {+ setEntityProperty: expect.objectContaining({ id: 'assignment-1' }),+ },+ }),+ })+ );+ });+});++describe('createGraphqlBulkSaveEntityPropertiesMutation', () => {+ let dispose: (() => void) | undefined;++ afterEach(() => dispose?.());++ it('runs bulk side effects through mutation callbacks', async () => {+ const events: string[] = [];+ const property = {+ propertyId: 'assignment-1',+ propertyDefinitionId: 'definition-1',+ displayName: 'Status',+ valueType: 'STRING',+ isMultiSelect: false,+ isSystemProperty: false,+ isMetadata: false,+ } as Property;+ const mutation = vi.fn(+ (+ _document: unknown,+ _variables: unknown,+ context: Record<string, unknown>+ ) => ({+ toPromise: async () => ({+ operation: { kind: 'mutation', context } as Operation,+ data: { setEntityProperty: { id: 'assignment-1' } },+ stale: false,+ hasNext: false,+ }),+ })+ );+ graphqlClientState.current = { mutation } as unknown as Client;+ let result!: ReturnType<+ typeof createGraphqlBulkSaveEntityPropertiesMutation<{ source: string }>+ >;++ createRoot((rootDispose) => {+ dispose = rootDispose;+ result = createGraphqlBulkSaveEntityPropertiesMutation({+ onMutate: () => {+ events.push('mutate');+ return { source: 'test' };+ },+ onCommitted: () => {+ events.push('committed');+ },+ onSuccess: (_input, context) => {+ events.push(`success:${context?.source}`);+ },+ onSettled: (error, _input, context) => {+ events.push(`settled:${error?.message ?? context?.source}`);+ },+ });+ });++ await result.mutateAsync({+ properties: [+ {+ entityType: 'DOCUMENT',+ entityId: 'document-1',+ property,+ apiValues: { valueType: 'STRING', value: 'doing' },+ },+ ],+ });++ expect(events).toEqual([+ 'mutate',+ 'committed',+ 'success:test',+ 'settled:test',+ ]);+ });+});++describe('createGraphqlEntityPropertiesQuery', () => {+ let dispose: (() => void) | undefined;++ beforeEach(() => {+ vi.clearAllMocks();+ graphqlClientState.current = undefined;+ mapGraphqlPropertiesMock.mockReturnValue([]);+ });++ afterEach(() => dispose?.());++ it('owns the live operation and refetches it network-only', async () => {+ const { requests } = makeControlledClient();+ const [entityType] = createSignal<EntityType>('DOCUMENT');+ const [entityId] = createSignal('entity-1');+ const [enabled] = createSignal(true);+ let query!: ReturnType<typeof createGraphqlEntityPropertiesQuery>;++ createRoot((rootDispose) => {+ dispose = rootDispose;+ query = createGraphqlEntityPropertiesQuery({+ entityType,+ entityId,+ enabled,+ });+ });++ await vi.waitFor(() => expect(requests).toHaveLength(1));+ expect(requests[0]?.operation.context.requestPolicy).toBe(+ 'cache-and-network'+ );+ requests[0]?.next({ data: EMPTY_DATA });+ await vi.waitFor(() => expect(query.result.data).toEqual([]));++ const refetch = query.refetch();+ await vi.waitFor(() => expect(requests).toHaveLength(2));+ expect(requests[1]?.operation.context.requestPolicy).toBe('network-only');+ requests[1]?.next({ data: EMPTY_DATA });+ await refetch;+ });++ it('does not start an operation for unsupported entity types', () => {+ const { requests } = makeControlledClient();+ const [entityType] = createSignal<EntityType>('USER');+ const [entityId] = createSignal('user-1');+ const [enabled] = createSignal(true);++ createRoot((rootDispose) => {+ dispose = rootDispose;+ const query = createGraphqlEntityPropertiesQuery({+ entityType,+ entityId,+ enabled,+ });+ expect(query.isEnabled()).toBe(false);+ });++ expect(requests).toHaveLength(0);+ });+});diff --git a/apps/web/src/lib/queries/properties/graphql/entity.ts b/apps/web/src/lib/queries/properties/graphql/entity.tsnew file mode 100644index 0000000000..d5927bf356--- /dev/null+++ b/apps/web/src/lib/queries/properties/graphql/entity.ts@@ -0,0 +1,534 @@+import { createUrqlMutation } from '@app/lib/urql-solid/create-urql-mutation';+import { createUrqlQuery } from '@app/lib/urql-solid/create-urql-query';+import type { UrqlMutationExecutor } from '@app/lib/urql-solid/types';+import { soupPropertyToProperty } from '@entity/extractors-property/property-helpers';+import {+ executeOptimisticMutation,+ optimisticMutationDispositionOf,+} from '@graphql-cache/index';+import { propertyValueToApi } from '@property/api/converters';+import type {+ Property,+ PropertyApiValues,+ PropertyDefinitionDomain,+} from '@property/types';+import { isInstantiatedProperty } from '@property/utils/typeGuards';+import type { EntityReference } from '@service-properties/generated/schemas/entityReference';+import type { EntityType } from '@service-properties/generated/schemas/entityType';+import type { PropertyTargetEntityType } from '@service-properties/generated/schemas/propertyTargetEntityType';+import type { SetPropertyValue } from '@service-properties/generated/schemas/setPropertyValue';+import type { SoupProperty } from '@service-storage/generated/schemas/soupProperty';+import {+ EntityPropertiesDocument,+ type EntityPropertiesQuery,+ type EntityPropertiesQueryVariables,+ type GraphqlEntityFilterAst,+ type GraphqlEntityReferenceInput,+ type GraphqlPropertyTargetEntityType,+ type GraphqlSetPropertyValue,+ SetEntityPropertyDocument,+ type SetEntityPropertyMutation,+ type SetEntityPropertyMutationVariables,+ type SoupInput,+} from '@service-storage/graphql/generated/graphql';+import {+ getGraphqlCacheHost,+ getGraphqlSoupClient,+ mapGraphqlProperties,+} from '@service-storage/graphql-soup';+import { CombinedError, type OperationResult } from '@urql/core';+import { type Accessor, createMemo } from 'solid-js';+import { match } from 'ts-pattern';+import {+ buildOptimisticGroupedPropertyUpdates,+ groupedPropertyKeys,+} from '../../soup/grouped/graphql-optimistic';+import { buildOptimisticSetEntityProperty } from '../graphql-optimistic';++const NIL_ENTITY_ID = '00000000-0000-0000-0000-000000000000';++/**+ * Builds an exact-entity Soup query. Every non-target branch is constrained to+ * the nil UUID because an omitted branch means "unfiltered", not "excluded".+ * Users are not represented in Soup and therefore keep using the REST reader.+ */+export function buildEntityPropertiesInput(+ entityType: EntityType,+ entityId: string+): SoupInput | undefined {+ const targetFilter: Partial<GraphqlEntityFilterAst> | undefined = match(+ entityType+ )+ .with('DOCUMENT', 'TASK', () => ({+ documentFilter: { literal: { id: entityId } },+ }))+ .with('PROJECT', () => ({+ projectFilter: { literal: { projectIdSelf: entityId } },+ }))+ .with('CHAT', () => ({+ chatFilter: { literal: { chatId: entityId } },+ }))+ .with('THREAD', () => ({+ emailFilter: { tree: { literal: { threadId: entityId } } },+ }))+ .with('CHANNEL', () => ({+ channelFilter: { literal: { channelId: entityId } },+ }))+ .with('CALL_RECORD', () => ({+ callFilter: { literal: { callId: entityId } },+ }))+ .with('COMPANY', () => ({+ crmCompanyFilter: { literal: { id: entityId } },+ }))+ .with('CALENDAR_EVENT', () => ({+ calendarEventFilter: { literal: { id: entityId } },+ }))+ .with('USER', () => undefined)+ .exhaustive();+ if (!targetFilter) return undefined;++ const filters: GraphqlEntityFilterAst = {+ calendarEventFilter: { literal: { id: NIL_ENTITY_ID } },+ documentFilter: { literal: { id: NIL_ENTITY_ID } },+ projectFilter: { literal: { projectIdSelf: NIL_ENTITY_ID } },+ chatFilter: { literal: { chatId: NIL_ENTITY_ID } },+ emailFilter: {+ tree: { literal: { threadId: NIL_ENTITY_ID } },+ },+ channelFilter: { literal: { channelId: NIL_ENTITY_ID } },+ channelThreadFilter: { literal: { threadId: NIL_ENTITY_ID } },+ callFilter: { literal: { callId: NIL_ENTITY_ID } },+ crmCompanyFilter: { literal: { id: NIL_ENTITY_ID } },+ foreignEntityFilter: { literal: { id: NIL_ENTITY_ID } },+ ...targetFilter,+ };++ return {+ initial: {+ limit: 1,+ expand: true,+ sortMethod: 'UPDATED_AT',+ emailView: 'ALL',+ filters,+ },+ };+}++type GraphqlEntityPropertiesQueryOptions = {+ entityType: Accessor<EntityType>;+ entityId: Accessor<string>;+ enabled: Accessor<boolean>;+};++/** Creates the live urql query for one Soup-backed entity's properties. */+export function createGraphqlEntityPropertiesQuery(+ options: GraphqlEntityPropertiesQueryOptions+) {+ const input = createMemo(() => {+ const entityId = options.entityId();+ if (!options.enabled() || entityId.length === 0) return undefined;+ return buildEntityPropertiesInput(options.entityType(), entityId);+ });++ const result = createUrqlQuery<+ EntityPropertiesQuery,+ EntityPropertiesQueryVariables,+ Property[]+ >(() => {+ const currentInput = input();+ const entityId = options.entityId();++ return {+ query: EntityPropertiesDocument,+ client: getGraphqlSoupClient(),+ variables: { input: currentInput! },+ enabled: currentInput !== undefined,+ requestPolicy: 'cache-and-network',+ keepPreviousData: false,+ select: (data) =>+ (mapGraphqlEntityProperties(data, entityId) ?? []).flatMap(+ (property) => {+ try {+ const mapped = soupPropertyToProperty(property);+ return mapped.isMetadata === true ? [] : [mapped];+ } catch (error) {+ console.warn(+ 'Skipping GraphQL property with unsupported type',+ error+ );+ return [];+ }+ }+ ),+ };+ });++ return {+ result,+ isEnabled: () => input() !== undefined,+ refetch: () => result.refetch({ requestPolicy: 'network-only' }),+ };+}++export type GraphqlEntityPropertyMutationInput =+ | {+ kind: 'save';+ entityType: EntityType | PropertyTargetEntityType;+ entityId: string;+ property: Property | PropertyDefinitionDomain;+ apiValues: PropertyApiValues;+ }+ | {+ kind: 'add';+ entityType: EntityType | PropertyTargetEntityType;+ entityId: string;+ propertyDefinitionId: string;+ };++export type EntityPropertyMutationDisposition =+ | {+ kind: 'committed';+ property?: SetEntityPropertyMutation['setEntityProperty'];+ }+ | { kind: 'queued'; transactionId: string }+ | { kind: 'permanently-failed'; error: Error };++type SetEntityPropertyArgs = {+ entityType: GraphqlPropertyTargetEntityType;+ entityId: string;+ propertyDefinitionId: string;+ value: SetPropertyValue | null;+ optimisticProperty?: ReturnType<typeof buildOptimisticSetEntityProperty>;+ optimisticCache?: Awaited<+ ReturnType<typeof buildOptimisticGroupedPropertyUpdates>+ >;+};++function toGraphqlEntityReference(+ reference: EntityReference+): GraphqlEntityReferenceInput {+ return {+ entityId: reference.entity_id,+ entityType: reference.entity_type,+ specificMessageId: reference.specific_message_id ?? null,+ };+}++function toGraphqlSetPropertyValue(+ value: SetPropertyValue | null+): GraphqlSetPropertyValue | null {+ if (value === null) return null;+ return match(value)+ .with({ type: 'boolean' }, (v) => ({ boolean: v.value }))+ .with({ type: 'date' }, (v) => ({ date: v.value }))+ .with({ type: 'number' }, (v) => ({ number: v.value }))+ .with({ type: 'string' }, (v) => ({ string: v.value }))+ .with({ type: 'select_option' }, (v) => ({ selectOption: v.option_id }))+ .with({ type: 'multi_select_option' }, (v) => ({+ multiSelectOption: v.option_ids,+ }))+ .with({ type: 'entity_reference' }, (v) => ({+ entityReference: toGraphqlEntityReference(v.reference),+ }))+ .with({ type: 'multi_entity_reference' }, (v) => ({+ multiEntityReference: v.references.map(toGraphqlEntityReference),+ }))+ .with({ type: 'link' }, (v) => ({ link: v.url }))+ .with({ type: 'multi_link' }, (v) => ({ multiLink: v.urls }))+ .exhaustive();+}++function toGraphqlPropertyTargetEntityType(+ entityType: EntityType | PropertyTargetEntityType+): GraphqlPropertyTargetEntityType {+ if (entityType === 'TASK') return 'DOCUMENT';+ if (entityType === 'CALENDAR_EVENT') {+ throw new Error('calendar events do not support properties');+ }+ return entityType;+}++function getPropertyDefinitionId(+ property: Property | PropertyDefinitionDomain+): string {+ return isInstantiatedProperty(property)+ ? property.propertyDefinitionId+ : property.id;+}++async function prepareMutationArgs(+ input: GraphqlEntityPropertyMutationInput+): Promise<SetEntityPropertyArgs> {+ if (input.kind === 'add') {+ return {+ entityType: toGraphqlPropertyTargetEntityType(input.entityType),+ entityId: input.entityId,+ propertyDefinitionId: input.propertyDefinitionId,+ value: null,+ };+ }++ const optimisticProperty = buildOptimisticSetEntityProperty(+ input.property,+ input.apiValues+ );+ let optimisticCache;++ if (isInstantiatedProperty(input.property)) {+ const host = getGraphqlCacheHost();+ if (host) {+ try {+ const oldGroupKeys = groupedPropertyKeys(input.property);+ const newGroupKeys = groupedPropertyKeys(input.apiValues);+ optimisticCache = await buildOptimisticGroupedPropertyUpdates({+ host,+ entityId: input.entityId,+ propertyDefinitionId: input.property.propertyDefinitionId,+ oldGroupKeys: oldGroupKeys ?? [],+ newGroupKeys: newGroupKeys ?? [],+ revalidateOnly:+ oldGroupKeys === undefined || newGroupKeys === undefined,+ });+ } catch (error) {+ // Relation discovery is an optimization. The normalized property write+ // remains valid when cache inspection is unavailable.+ console.warn('Failed to build grouped Soup optimism', error);+ }+ }+ }++ return {+ entityType: toGraphqlPropertyTargetEntityType(input.entityType),+ entityId: input.entityId,+ propertyDefinitionId: getPropertyDefinitionId(input.property),+ value: propertyValueToApi(input.apiValues, input.property.isMultiSelect),+ optimisticProperty,+ optimisticCache,+ };+}++function mutationDisposition(+ result: OperationResult<+ SetEntityPropertyMutation,+ SetEntityPropertyMutationVariables+ >+): EntityPropertyMutationDisposition {+ const disposition = optimisticMutationDispositionOf(result);+ if (disposition?.kind === 'queued') return disposition;+ if (disposition?.kind === 'permanently-failed') return disposition;+ if (disposition?.kind === 'committed') {+ return {+ kind: 'committed',+ property: disposition.data.setEntityProperty,+ };+ }+ if (result.error) {+ return { kind: 'permanently-failed', error: result.error };+ }+ if (!result.data) {+ return {+ kind: 'permanently-failed',+ error: new Error('setEntityProperty mutation returned no data'),+ };+ }+ return { kind: 'committed', property: result.data.setEntityProperty };+}++const executeGraphqlEntityPropertyMutation: UrqlMutationExecutor<+ SetEntityPropertyMutation,+ SetEntityPropertyMutationVariables,+ GraphqlEntityPropertyMutationInput+> = async ({ client, mutation, input, context }) => {+ const args = await prepareMutationArgs(input);+ const variables: SetEntityPropertyMutationVariables = {+ input: {+ entityType: args.entityType,+ entityId: args.entityId,+ propertyDefinitionId: args.propertyDefinitionId,+ value: toGraphqlSetPropertyValue(args.value),+ },+ };++ const mutationResult = await (args.optimisticProperty+ ? executeOptimisticMutation(+ client,+ mutation,+ variables,+ { setEntityProperty: args.optimisticProperty },+ args.optimisticCache+ ).toPromise()+ : client.mutation(mutation, variables, context).toPromise());+ const disposition = mutationDisposition(mutationResult);+ if (disposition.kind !== 'permanently-failed' || mutationResult.error) {+ return mutationResult;+ }+ return {+ ...mutationResult,+ error:+ disposition.error instanceof CombinedError+ ? disposition.error+ : new CombinedError({ networkError: disposition.error }),+ };+};++export type AddEntityPropertyInput = {+ entityType: EntityType | PropertyTargetEntityType;+ entityId: string;+ propertyDefinitionId: string;+};++type GraphqlAddMutationOptions<Context> = {+ onMutate?: (input: AddEntityPropertyInput) => Context | Promise<Context>;+ onSuccess?: (+ input: AddEntityPropertyInput,+ context: Context | undefined+ ) => void | Promise<void>;+ onError?: (+ error: Error,+ input: AddEntityPropertyInput,+ context: Context | undefined+ ) => void | Promise<void>;+ onSettled?: (+ error: Error | null,+ input: AddEntityPropertyInput,+ context: Context | undefined+ ) => void | Promise<void>;+};++/** Creates the callback-driven urql mutation for property attachments. */+export function createGraphqlAddEntityPropertyMutation<Context = void>(+ options: GraphqlAddMutationOptions<Context> = {}+) {+ return createUrqlMutation<+ SetEntityPropertyMutation,+ SetEntityPropertyMutationVariables,+ AddEntityPropertyInput,+ Context+ >(() => ({+ mutation: SetEntityPropertyDocument,+ client: getGraphqlSoupClient(),+ execute: ({ client, mutation, input, context }) =>+ executeGraphqlEntityPropertyMutation({+ client,+ mutation,+ input: { kind: 'add', ...input },+ context,+ }),+ onMutate: options.onMutate,+ onSuccess: (_data, input, context) => options.onSuccess?.(input, context),+ onError: (error, input, context) =>+ options.onError?.(error, input, context),+ onSettled: (_data, error, input, context) =>+ options.onSettled?.(error, input, context),+ }));+}++export type BulkSaveEntityPropertiesInput = {+ properties: Array<{+ entityType: EntityType | PropertyTargetEntityType;+ entityId: string;+ property: Property | PropertyDefinitionDomain;+ apiValues: PropertyApiValues;+ }>;+};++type GraphqlBulkMutationOptions<Context> = {+ onMutate?: (+ input: BulkSaveEntityPropertiesInput+ ) => Context | Promise<Context>;+ onCommitted?: (+ item: BulkSaveEntityPropertiesInput['properties'][number],+ disposition: Extract<+ EntityPropertyMutationDisposition,+ { kind: 'committed' }+ >+ ) => void | Promise<void>;+ onSuccess?: (+ input: BulkSaveEntityPropertiesInput,+ context: Context | undefined+ ) => void | Promise<void>;+ onError?: (+ error: Error,+ input: BulkSaveEntityPropertiesInput,+ context: Context | undefined+ ) => void | Promise<void>;+ onSettled?: (+ error: Error | null,+ input: BulkSaveEntityPropertiesInput,+ context: Context | undefined+ ) => void | Promise<void>;+};++/** Creates one callback-driven urql mutation for a bulk property save. */+export function createGraphqlBulkSaveEntityPropertiesMutation<Context = void>(+ options: GraphqlBulkMutationOptions<Context> = {}+) {+ return createUrqlMutation<+ SetEntityPropertyMutation,+ SetEntityPropertyMutationVariables,+ BulkSaveEntityPropertiesInput,+ Context+ >(() => ({+ mutation: SetEntityPropertyDocument,+ client: getGraphqlSoupClient(),+ execute: async ({ client, mutation, input, context }) => {+ let latestResult:+ | OperationResult<+ SetEntityPropertyMutation,+ SetEntityPropertyMutationVariables+ >+ | undefined;+ let permanentError: Error | undefined;++ // Begin each durable layer sequentially so later relation recipes see+ // the effective result of earlier property edits.+ for (const item of input.properties) {+ latestResult = await executeGraphqlEntityPropertyMutation({+ client,+ mutation,+ input: { kind: 'save', ...item },+ context,+ });+ const disposition = mutationDisposition(latestResult);+ if (disposition.kind === 'committed') {+ await options.onCommitted?.(item, disposition);+ } else if (disposition.kind === 'permanently-failed') {+ permanentError ??= disposition.error;+ }+ }++ if (!latestResult) {+ throw new Error(+ 'bulk property mutation requires at least one property'+ );+ }+ if (!permanentError) return latestResult;++ return {+ ...latestResult,+ error:+ permanentError instanceof CombinedError+ ? permanentError+ : new CombinedError({ networkError: permanentError }),+ };+ },+ onMutate: options.onMutate,+ onSuccess: (_data, input, context) => options.onSuccess?.(input, context),+ onError: (error, input, context) =>+ options.onError?.(error, input, context),+ onSettled: (_data, error, input, context) =>+ options.onSettled?.(error, input, context),+ }));+}++/** Maps one entity's GraphQL query result to the shared Soup property shape. */+export function mapGraphqlEntityProperties(+ data: EntityPropertiesQuery | undefined,+ entityId: string+): SoupProperty[] | undefined {+ if (!data) return undefined;+ const item = data.user.soup.items.find(+ (candidate) => candidate.id === entityId+ );+ return mapGraphqlProperties(item?.properties ?? []);+}diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-properties.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql-properties.test.tsdeleted file mode 100644index 3ff658b9a3..0000000000--- a/apps/web/src/lib/service-clients/service-storage/graphql-properties.test.ts+++ /dev/null@@ -1,265 +0,0 @@-import { ENABLE_GRAPHQL_SOUP } from '@core/constant/featureFlags';-import { beforeEach, describe, expect, it, vi } from 'vitest';-import { propertiesServiceClient } from '../service-properties/client';-import type { SetPropertyValue } from '../service-properties/generated/schemas/setPropertyValue';-import type { SoupPropertyFieldsFragment } from './graphql/generated/graphql';-import {- setEntityProperty,- toGraphqlPropertyEntityType,- toGraphqlPropertyTargetEntityType,- toGraphqlSetPropertyValue,-} from './graphql-properties';-import { getGraphqlSoupClient } from './graphql-soup';--vi.mock('@core/constant/featureFlags', () => ({- ENABLE_GRAPHQL_SOUP: vi.fn(() => false),-}));--vi.mock('../service-properties/client', () => ({- propertiesServiceClient: {- setEntityProperty: vi.fn(),- },-}));--vi.mock('./graphql-soup', () => ({- getGraphqlSoupClient: vi.fn(),-}));--const restSetEntityProperty = vi.mocked(- propertiesServiceClient.setEntityProperty-);-const flag = vi.mocked(ENABLE_GRAPHQL_SOUP);--type MutationResult = {- data?: unknown;- error?: unknown;- extensions?: Record<string, unknown>;-};--function mockGraphqlClient(result: MutationResult) {- const mutation = vi.fn(() => ({- toPromise: async () => result,- }));- vi.mocked(getGraphqlSoupClient).mockReturnValue({ mutation } as never);- return mutation;-}--const okRestResult = { isErr: () => false, value: { success: true } } as never;--describe('toGraphqlSetPropertyValue', () => {- it('converts every REST variant to the one-of input', () => {- const cases: Array<[SetPropertyValue | null, unknown]> = [- [null, null],- [{ type: 'boolean', value: true }, { boolean: true }],- [{ type: 'date', value: '2026-07-10' }, { date: '2026-07-10' }],- [{ type: 'number', value: 4.5 }, { number: 4.5 }],- [{ type: 'string', value: 'hi' }, { string: 'hi' }],- [- { type: 'select_option', option_id: 'opt-1' },- { selectOption: 'opt-1' },- ],- [- { type: 'multi_select_option', option_ids: ['a', 'b'] },- { multiSelectOption: ['a', 'b'] },- ],- [- {- type: 'entity_reference',- reference: {- entity_id: 'doc-1',- entity_type: 'DOCUMENT',- specific_message_id: 'msg-1',- },- },- {- entityReference: {- entityId: 'doc-1',- entityType: 'DOCUMENT',- specificMessageId: 'msg-1',- },- },- ],- [- {- type: 'multi_entity_reference',- references: [{ entity_id: 'u-1', entity_type: 'USER' }],- },- {- multiEntityReference: [- { entityId: 'u-1', entityType: 'USER', specificMessageId: null },- ],- },- ],- [{ type: 'link', url: 'https://a' }, { link: 'https://a' }],- [- { type: 'multi_link', urls: ['https://a', 'https://b'] },- { multiLink: ['https://a', 'https://b'] },- ],- ];- for (const [input, expected] of cases) {- expect(toGraphqlSetPropertyValue(input)).toEqual(expected);- }- });-});--describe('property entity type conversion', () => {- it('keeps TASK for referenced property values', () => {- expect(toGraphqlPropertyEntityType('TASK')).toBe('TASK');- });-- it('maps canonical property targets without TASK', () => {- expect(toGraphqlPropertyTargetEntityType('DOCUMENT')).toBe('DOCUMENT');- expect(toGraphqlPropertyTargetEntityType('COMPANY')).toBe('COMPANY');- expect(toGraphqlPropertyTargetEntityType('CALL_RECORD')).toBe(- 'CALL_RECORD'- );- });-});--describe('setEntityProperty', () => {- beforeEach(() => {- vi.clearAllMocks();- flag.mockReturnValue(false);- });-- const args = {- entityType: 'DOCUMENT' as const,- entityId: 'doc-1',- propertyDefinitionId: 'def-1',- value: { type: 'string', value: 'hi' } satisfies SetPropertyValue,- };-- it('uses the REST PUT when the flag is disabled', async () => {- restSetEntityProperty.mockResolvedValue(okRestResult);- const mutation = mockGraphqlClient({ data: undefined });-- await expect(setEntityProperty(args)).resolves.toEqual({- kind: 'committed',- });-- expect(restSetEntityProperty).toHaveBeenCalledWith({- entity_type: 'DOCUMENT',- entity_id: 'doc-1',- property_id: 'def-1',- body: { value: { type: 'string', value: 'hi' } },- });- expect(mutation).not.toHaveBeenCalled();- });-- it('returns permanently-failed for REST errors', async () => {- restSetEntityProperty.mockResolvedValue({- isErr: () => true,- error: [{ code: 'boom', message: 'boom' }],- } as never);-- const result = await setEntityProperty(args);-- expect(result.kind).toBe('permanently-failed');- if (result.kind === 'permanently-failed') {- expect(result.error).toBeInstanceOf(Error);- }- });-- it('executes the GraphQL mutation when the flag is enabled', async () => {- flag.mockReturnValue(true);- const property = { id: 'prop-1' } as SoupPropertyFieldsFragment;- const mutation = mockGraphqlClient({- data: { setEntityProperty: property },- extensions: {- normalizedCacheMutationDisposition: { kind: 'committed' },- },- });-- const result = await setEntityProperty(args);-- expect(restSetEntityProperty).not.toHaveBeenCalled();- expect(mutation).toHaveBeenCalledOnce();- const [, variables, context] = mutation.mock.calls[0] as unknown as [- unknown,- unknown,- unknown,- ];- expect(variables).toEqual({- input: {- entityType: 'DOCUMENT',- entityId: 'doc-1',- propertyDefinitionId: 'def-1',- value: { string: 'hi' },- },- });- expect(context).toBeUndefined();- expect(result).toEqual({ kind: 'committed', property });- });-- it('attaches the optimistic response to the mutation context', async () => {- flag.mockReturnValue(true);- const optimistic = { id: 'prop-1' } as SoupPropertyFieldsFragment;- const mutation = mockGraphqlClient({- data: { setEntityProperty: optimistic },- });-- await setEntityProperty({ ...args, optimisticProperty: optimistic });-- const [, , context] = mutation.mock.calls[0] as unknown as [- unknown,- unknown,- Record<string, unknown>,- ];- expect(context).toEqual({- normalizedCacheOptimistic: {- optimisticResponse: { setEntityProperty: optimistic },- linkPatches: [],- revalidations: [],- },- });- });-- it('returns queued when the durable exchange retains the mutation', async () => {- flag.mockReturnValue(true);- const optimistic = { id: 'prop-1' } as SoupPropertyFieldsFragment;- mockGraphqlClient({- data: { setEntityProperty: optimistic },- error: new Error('offline'),- extensions: {- normalizedCacheMutationDisposition: {- kind: 'queued',- transactionId: 'txn-1',- },- },- });-- await expect(- setEntityProperty({ ...args, optimisticProperty: optimistic })- ).resolves.toEqual({ kind: 'queued', transactionId: 'txn-1' });- });-- it('returns permanently-failed after the durable exchange rolls back', async () => {- flag.mockReturnValue(true);- const error = new Error('mutation failed');- mockGraphqlClient({- error,- extensions: {- normalizedCacheMutationDisposition: {- kind: 'permanently-failed',- transactionId: 'txn-1',- },- },- });-- await expect(setEntityProperty(args)).resolves.toEqual({- kind: 'permanently-failed',- error,- });- });-- it('returns permanently-failed for non-durable GraphQL errors', async () => {- flag.mockReturnValue(true);- const error = new Error('mutation failed');- mockGraphqlClient({ error });-- await expect(setEntityProperty(args)).resolves.toEqual({- kind: 'permanently-failed',- error,- });- });-});diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-properties.ts b/apps/web/src/lib/service-clients/service-storage/graphql-properties.tsdeleted file mode 100644index 88e57e2a23..0000000000--- a/apps/web/src/lib/service-clients/service-storage/graphql-properties.ts+++ /dev/null@@ -1,239 +0,0 @@-/**- * Property-write transport: routes `setEntityProperty` through the GraphQL- * mutation (normalized-cache-aware) when `ENABLE_GRAPHQL_SOUP` is on, and- * through the existing REST PUT otherwise. Callers keep REST-shaped inputs;- * conversion to the GraphQL input types happens here, strongly typed- * against the generated operation.- *- * The atomic tag-option add/remove endpoints intentionally stay on REST:- * they are server-side deltas, and replacing them with full-value writes- * would regress concurrent updates.- */--import { ENABLE_GRAPHQL_SOUP } from '@core/constant/featureFlags';-import { throwOnErr } from '@core/util/result';-import {- executeOptimisticMutation,- type OptimisticMutationOptions,- optimisticMutationDispositionOf,-} from '@graphql-cache/index';-import { match } from 'ts-pattern';-import { propertiesServiceClient } from '../service-properties/client';-import type { EntityReference } from '../service-properties/generated/schemas/entityReference';-import type { EntityType } from '../service-properties/generated/schemas/entityType';-import type { PropertyTargetEntityType } from '../service-properties/generated/schemas/propertyTargetEntityType';-import type { SetPropertyValue } from '../service-properties/generated/schemas/setPropertyValue';-import {- type GraphqlEntityReferenceInput,- type GraphqlPropertyEntityType,- type GraphqlPropertyTargetEntityType,- type GraphqlSetPropertyValue,- SetEntityPropertyDocument,- type SetEntityPropertyMutation,- type SetEntityPropertyMutationVariables,- type SoupPropertyFieldsFragment,-} from './graphql/generated/graphql';-import { getGraphqlSoupClient } from './graphql-soup';--/**- * REST entity type → GraphQL enum. The unions are currently identical, but- * the explicit table keeps divergence a compile error instead of a silent- * bad request.- */-const ENTITY_TYPE_TO_GRAPHQL: Record<EntityType, GraphqlPropertyEntityType> = {- CALENDAR_EVENT: 'CALENDAR_EVENT',- CALL_RECORD: 'CALL_RECORD',- CHANNEL: 'CHANNEL',- CHAT: 'CHAT',- COMPANY: 'COMPANY',- DOCUMENT: 'DOCUMENT',- PROJECT: 'PROJECT',- TASK: 'TASK',- THREAD: 'THREAD',- USER: 'USER',-};--export function toGraphqlPropertyEntityType(- entityType: EntityType-): GraphqlPropertyEntityType {- return ENTITY_TYPE_TO_GRAPHQL[entityType];-}--const TARGET_ENTITY_TYPE_TO_GRAPHQL: Record<- PropertyTargetEntityType,- GraphqlPropertyTargetEntityType-> = {- CALL_RECORD: 'CALL_RECORD',- CHANNEL: 'CHANNEL',- CHAT: 'CHAT',- COMPANY: 'COMPANY',- DOCUMENT: 'DOCUMENT',- PROJECT: 'PROJECT',- THREAD: 'THREAD',- USER: 'USER',-};--export function toGraphqlPropertyTargetEntityType(- entityType: PropertyTargetEntityType-): GraphqlPropertyTargetEntityType {- return TARGET_ENTITY_TYPE_TO_GRAPHQL[entityType];-}--function toGraphqlEntityReference(- reference: EntityReference-): GraphqlEntityReferenceInput {- return {- entityId: reference.entity_id,- entityType: toGraphqlPropertyEntityType(reference.entity_type),- specificMessageId: reference.specific_message_id ?? null,- };-}--/** REST `SetPropertyValue` → the GraphQL one-of input. */-export function toGraphqlSetPropertyValue(- value: SetPropertyValue | null-): GraphqlSetPropertyValue | null {- if (value === null) return null;- return match(value)- .with(- { type: 'boolean' },- (v): GraphqlSetPropertyValue => ({- boolean: v.value,- })- )- .with({ type: 'date' }, (v): GraphqlSetPropertyValue => ({ date: v.value }))- .with(- { type: 'number' },- (v): GraphqlSetPropertyValue => ({- number: v.value,- })- )- .with(- { type: 'string' },- (v): GraphqlSetPropertyValue => ({- string: v.value,- })- )- .with(- { type: 'select_option' },- (v): GraphqlSetPropertyValue => ({- selectOption: v.option_id,- })- )- .with(- { type: 'multi_select_option' },- (v): GraphqlSetPropertyValue => ({- multiSelectOption: v.option_ids,- })- )- .with(- { type: 'entity_reference' },- (v): GraphqlSetPropertyValue => ({- entityReference: toGraphqlEntityReference(v.reference),- })- )- .with(- { type: 'multi_entity_reference' },- (v): GraphqlSetPropertyValue => ({- multiEntityReference: v.references.map(toGraphqlEntityReference),- })- )- .with({ type: 'link' }, (v): GraphqlSetPropertyValue => ({ link: v.url }))- .with(- { type: 'multi_link' },- (v): GraphqlSetPropertyValue => ({- multiLink: v.urls,- })- )- .exhaustive();-}--export type SetEntityPropertyArgs = {- entityType: PropertyTargetEntityType;- entityId: string;- propertyDefinitionId: string;- /** REST-shaped value; `null` attaches the property without a value. */- value: SetPropertyValue | null;- /**- * Complete optimistic mutation payload for an *existing* assignment- * (its stable id updates the normalized record soup queries reference).- * Omit for new attachments — no assignment id exists until the server- * responds, so those run without optimism and rely on invalidation.- */- optimisticProperty?: SoupPropertyFieldsFragment | undefined;- /** Mutation-scoped persistent normalized-cache relation recipes. */- optimisticCache?: OptimisticMutationOptions;-};--/** Outcome of submitting one property mutation to its configured transport. */-export type SetEntityPropertyDisposition =- | { kind: 'committed'; property?: SoupPropertyFieldsFragment }- | { kind: 'queued'; transactionId: string }- | { kind: 'permanently-failed'; error: Error };--function asError(error: unknown): Error {- return error instanceof Error ? error : new Error(String(error));-}--/** Sets or durably queues one property assignment. */-export async function setEntityProperty(- args: SetEntityPropertyArgs-): Promise<SetEntityPropertyDisposition> {- if (!ENABLE_GRAPHQL_SOUP()) {- try {- await throwOnErr(- async () =>- await propertiesServiceClient.setEntityProperty({- entity_type: args.entityType,- entity_id: args.entityId,- property_id: args.propertyDefinitionId,- body: { value: args.value },- })- );- return { kind: 'committed' };- } catch (error) {- return { kind: 'permanently-failed', error: asError(error) };- }- }-- const client = getGraphqlSoupClient();- const variables: SetEntityPropertyMutationVariables = {- input: {- entityType: toGraphqlPropertyTargetEntityType(args.entityType),- entityId: args.entityId,- propertyDefinitionId: args.propertyDefinitionId,- value: toGraphqlSetPropertyValue(args.value),- },- };- const result = args.optimisticProperty- ? await executeOptimisticMutation(- client,- SetEntityPropertyDocument,- variables,- {- setEntityProperty: args.optimisticProperty,- } satisfies SetEntityPropertyMutation,- args.optimisticCache- ).toPromise()- : await client.mutation(SetEntityPropertyDocument, variables).toPromise();- const disposition = optimisticMutationDispositionOf(result);- if (disposition?.kind === 'queued') return disposition;- if (disposition?.kind === 'permanently-failed') return disposition;- if (disposition?.kind === 'committed') {- return {- kind: 'committed',- property: disposition.data.setEntityProperty,- };- }-- if (result.error) {- return { kind: 'permanently-failed', error: result.error };- }- if (!result.data) {- return {- kind: 'permanently-failed',- error: new Error('setEntityProperty mutation returned no data'),- };- }- return { kind: 'committed', property: result.data.setEntityProperty };-}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.tsindex 582cd257be..416c00e5b8 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@@ -29,6 +29,7 @@ import {import { match } from 'ts-pattern';import type { SoupApiItem } from './generated/schemas/soupApiItem';import type { SoupPage } from './generated/schemas/soupPage';+import type { SoupProperty } from './generated/schemas/soupProperty';import {type GroupedSoupInput,type GroupSoupQuery,@@ -36,6 +37,7 @@ import {type GroupSoupQueryVariables,type SoupInitialInput,type SoupInput,+ type SoupPropertyFieldsFragment,type SoupQuery,SoupDocument as SoupQueryDocument,type SoupQueryVariables,@@ -305,7 +307,10 @@ function mapGraphqlPropertyValue(.exhaustive();}-function mapGraphqlProperties(properties: GraphqlProperty[]) {+/** Maps GraphQL property fragments to the shared Soup property shape. */+export function mapGraphqlProperties(+ properties: SoupPropertyFieldsFragment[]+): SoupProperty[] {return properties.map((property) => ({id: property.id,definition: {diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/entity-properties.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/entity-properties.graphqlnew file mode 100644index 0000000000..ba806d12fd--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/graphql/entity-properties.graphql@@ -0,0 +1,14 @@+query EntityProperties($input: SoupInput!) {+ user {+ id+ soup(input: $input) {+ items {+ __typename+ id+ properties {+ ...SoupPropertyFields+ }+ }+ }+ }+}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.tsindex 284dda210b..b46a27616d 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@@ -1689,6 +1689,104 @@ export type SetEntityFavoriteMutation = { setEntityFavorite:> }};+export type EntityPropertiesQueryVariables = Exact<{+ input: SoupInput;+}>;+++export type EntityPropertiesQuery = { user: { id: string, soup: { items: Array<+ | { __typename: 'GraphqlSoupCalendarEvent', id: 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 }> }+ | { __typename: 'GraphqlSoupCall', id: 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 }> }+ | { __typename: 'GraphqlSoupChannel', id: 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 }> }+ | { __typename: 'GraphqlSoupChannelMessage', id: 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 }> }+ | { __typename: 'GraphqlSoupChat', id: 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 }> }+ | { __typename: 'GraphqlSoupCrmCompany', id: 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 }> }+ | { __typename: 'GraphqlSoupDocument', id: 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 }> }+ | { __typename: 'GraphqlSoupEmailThread', id: 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 }> }+ | { __typename: 'GraphqlSoupForeignEntity', id: 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 }> }+ | { __typename: 'GraphqlSoupProject', id: 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 }> }+ > } } };+export type GroupSoupMembershipQueryVariables = Exact<{input: GroupedSoupInput;}>;@@ -2227,6 +2325,7 @@ export const RestoreEntitiesDocument = {"kind":"Document","definitions":[{"kind"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":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationPayloadFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EntityMutationPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationResultFields"}}]}}]}}]} as unknown as DocumentNode<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":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationPayloadFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EntityMutationPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EntityMutationResultFields"}}]}}]}}]} as unknown as DocumentNode<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":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"done"}},{"kind":"Field","name":{"kind":"Name","value":"seen"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityCoreFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityCoreFields"}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestContentMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyParsed"}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPatchFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupPatch"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCacheDeletion"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EntityMutationResultFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityMutationResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"effects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPatchFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMutationError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errorCode"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]} as unknown as DocumentNode<SetEntityFavoriteMutation, SetEntityFavoriteMutationVariables>;+export const EntityPropertiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"EntityProperties"},"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":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"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<EntityPropertiesQuery, EntityPropertiesQueryVariables>;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>;