From 57d2b33ff4f021cf6535e5d24dbba8e7976a535e Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sat, 8 Jun 2024 00:08:18 +0200 Subject: [PATCH 1/4] refactor(event): Update after simplification of event tables See https://github.com/serlo/db-migrations/issues/344 --- __tests__/__utils__/assertions.ts | 11 +- __tests__/schema/event-types.ts | 17 +- __tests__/schema/user/delete-bots.ts | 6 +- docker-compose.yml | 2 +- packages/server/src/schema/events/event.ts | 204 +++++++----------- .../server/src/schema/events/resolvers.ts | 39 ++-- .../src/schema/notifications/resolvers.ts | 33 ++- .../server/src/schema/uuid/user/resolvers.ts | 14 +- 8 files changed, 132 insertions(+), 194 deletions(-) diff --git a/__tests__/__utils__/assertions.ts b/__tests__/__utils__/assertions.ts index 7f0b09f26..ea1908501 100644 --- a/__tests__/__utils__/assertions.ts +++ b/__tests__/__utils__/assertions.ts @@ -236,11 +236,16 @@ export async function assertErrorEvent(args?: { if (args?.errorContext !== undefined) { for (const contextName in args.errorContext) { - const contextValue = event.contexts?.error?.[contextName] + const contextValueString = event.contexts?.error?.[contextName] + const contextValue = destringifyProperties(contextValueString) const targetValue = args.errorContext[contextName] - if (!R.equals(destringifyProperties(contextValue), targetValue)) - return false + if (typeof targetValue === 'object' && targetValue !== null) { + if (!R.equals(R.pick(R.keys(targetValue), contextValue), targetValue)) + return false + } else { + if (contextValue !== targetValue) return false + } } } diff --git a/__tests__/schema/event-types.ts b/__tests__/schema/event-types.ts index f36a70065..01f2d8573 100644 --- a/__tests__/schema/event-types.ts +++ b/__tests__/schema/event-types.ts @@ -81,7 +81,7 @@ test('adds a notification', async () => { expect( await databaseForTests.fetchAll( - 'select * from notification_event where event_log_id = ?', + 'select * from notification_event where event_id = ?', [lastEvent.id], ), ).not.toHaveLength(0) @@ -100,19 +100,6 @@ test('fails if object does not exist', async () => { ).rejects.toThrow() }) -test('fails if name from parameters is invalid', async () => { - const initialEventsNumber = await getEventsNumber() - - await global.databaseForTests.mutate( - 'delete from event_parameter_name where name = "discussion"', - ) - - await expect(createEvent(basePayload, getContext())).rejects.toThrow() - - const finalEventsNumber = await getEventsNumber() - expect(finalEventsNumber).toEqual(initialEventsNumber) -}) - test('fails if uuid number in parameters does not exist', async () => { await expect( createEvent({ ...basePayload, threadId: 40000 }, getContext()), @@ -309,7 +296,7 @@ function getApiResult(event: Record): Record { async function getEventsNumber() { return ( await global.databaseForTests.fetchOne<{ n: number }>( - 'SELECT count(*) AS n FROM event_log', + 'SELECT count(*) AS n FROM event', ) ).n } diff --git a/__tests__/schema/user/delete-bots.ts b/__tests__/schema/user/delete-bots.ts index 539c478be..afe5fa333 100644 --- a/__tests__/schema/user/delete-bots.ts +++ b/__tests__/schema/user/delete-bots.ts @@ -137,11 +137,13 @@ describe('community chat', () => { returnsJson({ json: { success: false, errorType: 'unknown' } }), ) - await mutation.withInput({ botIds: [user2.id] }).execute() + await mutation + .withInput({ botIds: input.botIds.slice(1) }) + .shouldReturnData({ user: { deleteBots: { success: true } } }) await assertErrorEvent({ message: 'Cannot delete a user from community.serlo.org', - errorContext: { user: user2 }, + errorContext: { user: { id: input.botIds[1] } }, }) }) }) diff --git a/docker-compose.yml b/docker-compose.yml index 8e89ff54f..691402ce5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: ports: - '6379:6379' mysql: - image: eu.gcr.io/serlo-shared/serlo-mysql-database:latest + image: eu.gcr.io/serlo-shared/serlo-mysql-database:prerelease-simplify-event-tables platform: linux/x86_64 pull_policy: always ports: diff --git a/packages/server/src/schema/events/event.ts b/packages/server/src/schema/events/event.ts index b98a62a6b..3ed0d3621 100644 --- a/packages/server/src/schema/events/event.ts +++ b/packages/server/src/schema/events/event.ts @@ -39,47 +39,30 @@ export async function createEvent( try { const { insertId: eventId } = await database.mutate( ` - INSERT INTO event_log (actor_id, event_id, uuid_id, instance_id) - SELECT ?, event.id, ?, instance.id - FROM event, instance - WHERE event.name = ? and instance.subdomain = ? + INSERT INTO event + (actor_id, event_type_id, uuid_id, instance_id, + uuid_parameter, uuid_parameter2, string_parameter) + SELECT ?, event_type.id, ?, instance.id, ?, ?, ? + FROM event_type, instance + WHERE event_type.name = ? and instance.subdomain = ? `, - [actorId, objectId, type, instance], + [ + actorId, + objectId, + 'uuidParameter' in abstractEventPayload + ? abstractEventPayload.uuidParameter + : null, + 'uuidParameter2' in abstractEventPayload + ? abstractEventPayload.uuidParameter2 + : null, + 'stringParameter' in abstractEventPayload + ? abstractEventPayload.stringParameter + : null, + type, + instance, + ], ) - const { stringParameters, uuidParameters } = abstractEventPayload - const parameters = { ...stringParameters, ...uuidParameters } - - for (const [parameter, value] of Object.entries(parameters)) { - const { insertId: parameterId } = await database.mutate( - ` - INSERT INTO event_parameter (log_id, name_id) - SELECT ?, id - FROM event_parameter_name - WHERE name = ? - `, - [eventId, parameter], - ) - - if (typeof value === 'string') { - await database.mutate( - ` - INSERT INTO event_parameter_string (value, event_parameter_id) - VALUES (?, ?) - `, - [value, parameterId], - ) - } else { - await database.mutate( - ` - INSERT INTO event_parameter_uuid (uuid_id, event_parameter_id) - VALUES (?, ?) - `, - [value, parameterId], - ) - } - } - const event = { ...abstractEventPayload, id: eventId } await createNotifications(event, { database }) @@ -96,7 +79,11 @@ async function createNotifications( ) { const { objectId, actorId } = event - const objectIds = [objectId, ...Object.values(event.uuidParameters)] + const objectIds = [ + objectId, + ...('uuidParameter' in event ? [event.uuidParameter] : []), + ...('uuidParameter2' in event ? [event.uuidParameter2] : []), + ] const subscribers = [] for (const objectId of objectIds) { @@ -131,7 +118,7 @@ async function createNotifications( await database.mutate( ` - INSERT INTO notification_event (notification_id, event_log_id) + INSERT INTO notification_event (notification_id, event_id) SELECT LAST_INSERT_ID(), ? `, [event.id], @@ -161,14 +148,14 @@ export function toGraphQLModel( return { ...base, __typename: NotificationEventType.CreateComment, - threadId: event.uuidParameters.discussion, + threadId: event.uuidParameter, commentId: event.objectId, } } else if (event.type === EventType.CreateThread) { return { ...base, __typename: NotificationEventType.CreateThread, - objectId: event.uuidParameters.on, + objectId: event.uuidParameter, threadId: event.objectId, } } else if (event.type === EventType.CreateEntity) { @@ -194,13 +181,13 @@ export function toGraphQLModel( ? NotificationEventType.CreateEntityLink : NotificationEventType.RemoveEntityLink, childId: event.objectId, - parentId: event.uuidParameters.parent, + parentId: event.uuidParameter, } } else if (event.type === EventType.CreateEntityRevision) { return { ...base, __typename: NotificationEventType.CreateEntityRevision, - entityId: event.uuidParameters.repository, + entityId: event.uuidParameter, entityRevisionId: event.objectId, } } else if ( @@ -213,9 +200,9 @@ export function toGraphQLModel( event.type === EventType.CheckoutRevision ? NotificationEventType.CheckoutRevision : NotificationEventType.RejectRevision, - repositoryId: event.uuidParameters.repository, + repositoryId: event.uuidParameter, revisionId: event.objectId, - reason: event.stringParameters.reason, + reason: event.stringParameter, } } else if ( event.type === EventType.CreateTaxonomyLink || @@ -228,7 +215,7 @@ export function toGraphQLModel( ? NotificationEventType.CreateTaxonomyLink : NotificationEventType.RemoveTaxonomyLink, parentId: event.objectId, - childId: event.uuidParameters.object, + childId: event.uuidParameter, } } else if ( event.type === EventType.CreateTaxonomyTerm || @@ -247,8 +234,8 @@ export function toGraphQLModel( ...base, __typename: NotificationEventType.SetTaxonomyParent, childId: event.objectId, - previousParentId: event.uuidParameters.from, - parentId: event.uuidParameters.to, + previousParentId: event.uuidParameter, + parentId: event.uuidParameter2, } } else { return { @@ -262,11 +249,7 @@ export function toGraphQLModel( function toDatabaseRepresentation( event: PayloadForNewEvent, ): PayloadForNewAbstractEvent { - const base = { - ...R.pick(['actorId', 'instance'], event), - uuidParameters: {}, - stringParameters: {}, - } + const base = R.pick(['actorId', 'instance'], event) if (event.__typename === NotificationEventType.SetThreadState) { return { @@ -279,14 +262,14 @@ function toDatabaseRepresentation( ...base, type: EventType.CreateComment, objectId: event.commentId, - uuidParameters: { discussion: event.threadId }, + uuidParameter: event.threadId, } } else if (event.__typename === NotificationEventType.CreateThread) { return { ...base, type: EventType.CreateThread, objectId: event.threadId, - uuidParameters: { on: event.objectId }, + uuidParameter: event.objectId, } } else if (event.__typename === NotificationEventType.CreateEntity) { return { ...base, type: EventType.CreateEntity, objectId: event.entityId } @@ -307,14 +290,14 @@ function toDatabaseRepresentation( ? EventType.CreateEntityLink : EventType.RemoveEntityLink, objectId: event.childId, - uuidParameters: { parent: event.parentId }, + uuidParameter: event.parentId, } } else if (event.__typename === NotificationEventType.CreateEntityRevision) { return { ...base, type: EventType.CreateEntityRevision, objectId: event.entityRevisionId, - uuidParameters: { repository: event.entityId }, + uuidParameter: event.entityId, } } else if ( event.__typename === NotificationEventType.CheckoutRevision || @@ -327,8 +310,8 @@ function toDatabaseRepresentation( ? EventType.CheckoutRevision : EventType.RejectRevision, objectId: event.revisionId, - uuidParameters: { repository: event.repositoryId }, - stringParameters: { reason: event.reason }, + uuidParameter: event.repositoryId, + stringParameter: event.reason, } } else if ( event.__typename === NotificationEventType.CreateTaxonomyLink || @@ -341,7 +324,7 @@ function toDatabaseRepresentation( ? EventType.CreateTaxonomyLink : EventType.RemoveTaxonomyLink, objectId: event.parentId, - uuidParameters: { object: event.childId }, + uuidParameter: event.childId, } } else if ( event.__typename === NotificationEventType.CreateTaxonomyTerm || @@ -360,7 +343,8 @@ function toDatabaseRepresentation( ...base, type: EventType.SetTaxonomyParent, objectId: event.childId, - uuidParameters: { from: event.previousParentId, to: event.parentId }, + uuidParameter: event.previousParentId, + uuidParameter2: event.parentId, } } else { return { @@ -438,96 +422,78 @@ type PayloadForNewEvent = const DatabaseEventRepresentations = { ArchiveThread: getDatabaseRepresentationDecoder({ type: EventType.ArchiveThread, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), RestoreThread: getDatabaseRepresentationDecoder({ type: EventType.RestoreThread, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), CreateComment: getDatabaseRepresentationDecoder({ type: EventType.CreateComment, - uuidParameters: t.type({ discussion: t.number }), - stringParameters: t.type({}), + parameters: t.type({ uuidParameter: t.number }), }), CreateThread: getDatabaseRepresentationDecoder({ type: EventType.CreateThread, - uuidParameters: t.type({ on: t.number }), - stringParameters: t.type({}), + parameters: t.type({ uuidParameter: t.number }), }), CreateEntity: getDatabaseRepresentationDecoder({ type: EventType.CreateEntity, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), SetLicense: getDatabaseRepresentationDecoder({ type: EventType.SetLicense, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), CreateEntityLink: getDatabaseRepresentationDecoder({ type: EventType.CreateEntityLink, - uuidParameters: t.type({ parent: t.number }), - stringParameters: t.type({}), + parameters: t.type({ uuidParameter: t.number }), }), RemoveEntityLink: getDatabaseRepresentationDecoder({ type: EventType.RemoveEntityLink, - uuidParameters: t.type({ parent: t.number }), - stringParameters: t.type({}), + parameters: t.type({ uuidParameter: t.number }), }), CreateEntityRevision: getDatabaseRepresentationDecoder({ type: EventType.CreateEntityRevision, - uuidParameters: t.type({ repository: t.number }), - stringParameters: t.type({}), + parameters: t.type({ uuidParameter: t.number }), }), CheckoutRevision: getDatabaseRepresentationDecoder({ type: EventType.CheckoutRevision, - uuidParameters: t.type({ repository: t.number }), - stringParameters: t.type({ reason: t.string }), + parameters: t.type({ uuidParameter: t.number, stringParameter: t.string }), }), RejectRevision: getDatabaseRepresentationDecoder({ type: EventType.RejectRevision, - uuidParameters: t.type({ repository: t.number }), - stringParameters: t.type({ reason: t.string }), + parameters: t.type({ uuidParameter: t.number, stringParameter: t.string }), }), CreateTaxonomyLink: getDatabaseRepresentationDecoder({ type: EventType.CreateTaxonomyLink, - uuidParameters: t.type({ object: t.number }), - stringParameters: t.type({}), + parameters: t.type({ uuidParameter: t.number }), }), RemoveTaxonomyLink: getDatabaseRepresentationDecoder({ type: EventType.RemoveTaxonomyLink, - uuidParameters: t.type({ object: t.number }), - stringParameters: t.type({}), + parameters: t.type({ uuidParameter: t.number }), }), CreateTaxonomyTerm: getDatabaseRepresentationDecoder({ type: EventType.CreateTaxonomyTerm, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), SetTaxonomyTerm: getDatabaseRepresentationDecoder({ type: EventType.SetTaxonomyTerm, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), SetTaxonomyParent: getDatabaseRepresentationDecoder({ type: EventType.SetTaxonomyParent, - uuidParameters: t.type({ - from: t.union([t.number, t.null]), - to: t.union([t.number, t.null]), + parameters: t.type({ + uuidParameter: t.union([t.number, t.null]), + uuidParameter2: t.union([t.number, t.null]), }), - stringParameters: t.type({}), }), TrashUuid: getDatabaseRepresentationDecoder({ type: EventType.TrashUuid, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), RestoreUuid: getDatabaseRepresentationDecoder({ type: EventType.RestoreUuid, - uuidParameters: t.type({}), - stringParameters: t.type({}), + parameters: t.type({}), }), } as const @@ -555,25 +521,21 @@ export const DatabaseEventRepresentation: t.Type = function getDatabaseRepresentationDecoder< Type extends EventType, - UuidParameters extends Record, - StringParameters extends Record, ->({ - type, - uuidParameters, - stringParameters, -}: { - type: Type - uuidParameters: t.Type - stringParameters: t.Type -}) { - return t.type({ - id: t.number, - type: t.literal(type), - actorId: t.number, - date: DateDecoder, - objectId: t.number, - instance: InstanceDecoder, - uuidParameters: uuidParameters, - stringParameters: stringParameters, - }) + Parameters extends { + uuidParameter?: number | null + uuidParameter2?: number | null + stringParameter?: string + }, +>({ type, parameters }: { type: Type; parameters: t.Type }) { + return t.intersection([ + t.type({ + id: t.number, + type: t.literal(type), + actorId: t.number, + date: DateDecoder, + objectId: t.number, + instance: InstanceDecoder, + }), + parameters, + ]) } diff --git a/packages/server/src/schema/events/resolvers.ts b/packages/server/src/schema/events/resolvers.ts index 0e2b28229..2f5caba09 100644 --- a/packages/server/src/schema/events/resolvers.ts +++ b/packages/server/src/schema/events/resolvers.ts @@ -62,33 +62,24 @@ async function resolveEventsFromDB( const rows = await database.fetchAll( ` select - event_log.id as id, - event.name as type, - event_log.actor_id as actorId, + event.id as id, + event_type.name as type, + event.actor_id as actorId, instance.subdomain as instance, - event_log.date as date, - event_log.uuid_id as objectId, - JSON_OBJECTAGG( - COALESCE(event_parameter_name.name, "__unused"), - event_parameter_uuid.uuid_id - ) as uuidParameters, - JSON_OBJECTAGG( - COALESCE(event_parameter_name.name, "__unused"), - event_parameter_string.value - ) as stringParameters - from event_log - join event on event.id = event_log.event_id - join instance on event_log.instance_id = instance.id - left join event_parameter on event_parameter.log_id = event_log.id - left join event_parameter_name on event_parameter.name_id = event_parameter_name.id - left join event_parameter_string on event_parameter_string.event_parameter_id = event_parameter.id - left join event_parameter_uuid on event_parameter_uuid.event_parameter_id = event_parameter.id + event.date as date, + event.uuid_id as objectId, + event.uuid_parameter as uuidParameter, + event.uuid_parameter2 as uuidParameter2, + event.string_parameter as stringParameter + from event + join event_type on event_type.id = event.event_type_id + join instance on event.instance_id = instance.id where - event_log.id < ? - and (? is null or event_log.uuid_id = ?) - and (? is null or event_log.actor_id = ?) + event.id < ? + and (? is null or event.uuid_id = ?) + and (? is null or event.actor_id = ?) and (? is null or instance.subdomain = ?) - group by event_log.id + group by event.id order by id desc limit ? `, diff --git a/packages/server/src/schema/notifications/resolvers.ts b/packages/server/src/schema/notifications/resolvers.ts index 7508508c0..c4a1c8ab5 100644 --- a/packages/server/src/schema/notifications/resolvers.ts +++ b/packages/server/src/schema/notifications/resolvers.ts @@ -47,31 +47,22 @@ export const NotificationsResolver = createCachedResolver({ notification.seen, notification.email_sent as emailSent, notification.email, - event_log.id as eventId, - event.name as type, - event_log.actor_id as actorId, + event.id as eventId, + event_type.name as type, + event.actor_id as actorId, instance.subdomain as instance, - event_log.date as date, - event_log.uuid_id as objectId, - JSON_OBJECTAGG( - COALESCE(event_parameter_name.name, "__unused"), - event_parameter_uuid.uuid_id - ) as uuidParameters, - JSON_OBJECTAGG( - COALESCE(event_parameter_name.name, "__unused"), - event_parameter_string.value - ) as stringParameters + event.date as date, + event.uuid_id as objectId, + event.uuid_parameter as uuidParameter, + event.uuid_parameter2 as uuidParameter2, + event.string_parameter as stringParameter from notification join notification_event ON notification.id = notification_event.notification_id - join event_log on event_log.id = notification_event.event_log_id - join event on event.id = event_log.event_id - join instance on event_log.instance_id = instance.id - left join event_parameter on event_parameter.log_id = event_log.id - left join event_parameter_name on event_parameter.name_id = event_parameter_name.id - left join event_parameter_string on event_parameter_string.event_parameter_id = event_parameter.id - left join event_parameter_uuid on event_parameter_uuid.event_parameter_id = event_parameter.id + join event on event.id = notification_event.event_id + join event_type on event_type.id = event.event_type_id + join instance on event.instance_id = instance.id where notification.user_id = ? - group by notification.id, event_log.id + group by notification.id, event.id order by notification.date desc, notification.id desc `, [userId], diff --git a/packages/server/src/schema/uuid/user/resolvers.ts b/packages/server/src/schema/uuid/user/resolvers.ts index 92f2ae33b..58697cd19 100644 --- a/packages/server/src/schema/uuid/user/resolvers.ts +++ b/packages/server/src/schema/uuid/user/resolvers.ts @@ -71,10 +71,10 @@ export const ActiveUserIdsResolver = createCachedResolver< ` SELECT u.id FROM user u - JOIN event_log e ON u.id = e.actor_id - WHERE e.event_id = 5 AND e.date > DATE_SUB(?, Interval 90 day) + JOIN event e ON u.id = e.actor_id + WHERE e.event_type_id = 5 AND e.date > DATE_SUB(?, Interval 90 day) GROUP BY u.id - HAVING count(e.event_id) > 10 + HAVING count(e.event_type_id) > 10 `, [new Date(timer.now()).toISOString()], ) @@ -499,10 +499,10 @@ export const resolvers: Resolvers = { 'UPDATE entity_revision SET author_id = ? WHERE author_id = ?', [idUserDeleted, id], ), - database.mutate( - 'UPDATE event_log SET actor_id = ? WHERE actor_id = ?', - [idUserDeleted, id], - ), + database.mutate('UPDATE event SET actor_id = ? WHERE actor_id = ?', [ + idUserDeleted, + id, + ]), database.mutate( 'UPDATE page_revision SET author_id = ? WHERE author_id = ?', [idUserDeleted, id], From 6c5b403057e7afaf3c990b5f6b608f18fe85b7bc Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sat, 8 Jun 2024 00:11:46 +0200 Subject: [PATCH 2/4] fix(event): Return all events which affected a uuid Fixes #1459 --- packages/server/src/schema/events/resolvers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/schema/events/resolvers.ts b/packages/server/src/schema/events/resolvers.ts index 2f5caba09..e85030624 100644 --- a/packages/server/src/schema/events/resolvers.ts +++ b/packages/server/src/schema/events/resolvers.ts @@ -76,7 +76,8 @@ async function resolveEventsFromDB( join instance on event.instance_id = instance.id where event.id < ? - and (? is null or event.uuid_id = ?) + and (? is null or event.uuid_id = ? or event.uuid_parameter = ? + or event.uuid_parameter2 = ?) and (? is null or event.actor_id = ?) and (? is null or instance.subdomain = ?) group by event.id @@ -88,6 +89,8 @@ async function resolveEventsFromDB( after ?? 2147483647, objectId ?? null, objectId ?? null, + objectId ?? null, + objectId ?? null, actorId ?? null, actorId ?? null, instance ?? null, From 7722de8166d82593d1865312a0cdfc588593cc91 Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sat, 8 Jun 2024 00:14:47 +0200 Subject: [PATCH 3/4] test(delete-bots): Remove unused import --- __tests__/schema/user/delete-bots.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/__tests__/schema/user/delete-bots.ts b/__tests__/schema/user/delete-bots.ts index afe5fa333..162f11cd6 100644 --- a/__tests__/schema/user/delete-bots.ts +++ b/__tests__/schema/user/delete-bots.ts @@ -2,14 +2,14 @@ import { createHash } from 'crypto' import gql from 'graphql-tag' import { HttpResponse, ResponseResolver, http } from 'msw' -import { article, user, user2 } from '../../../__fixtures__' +import { article, user } from '../../../__fixtures__' import { - given, Client, Query, - returnsJson, assertErrorEvent, assertNoErrorEvents, + given, + returnsJson, userQuery, } from '../../__utils__' From dccdffed25f450c3aefd2f219de0cbab84334778 Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Sat, 8 Jun 2024 12:13:03 +0200 Subject: [PATCH 4/4] test(events): Fix test with objectId --- __tests__/schema/events.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/schema/events.ts b/__tests__/schema/events.ts index 384e42b87..7a2795fbf 100644 --- a/__tests__/schema/events.ts +++ b/__tests__/schema/events.ts @@ -97,7 +97,7 @@ describe('query endpoint "events"', () => { test('with filter "objectId"', async () => { await query.withVariables({ first: 1, objectId: 1855 }).shouldReturnData({ events: { - nodes: [{ __typename: 'CreateEntityNotificationEvent', id: 1198 }], + nodes: [{ __typename: 'CheckoutRevisionNotificationEvent', id: 77030 }], }, }) })