From a99a71889c1e263dbd7f590e6e5f55e54964113f Mon Sep 17 00:00:00 2001 From: Wojciech Trocki Date: Thu, 8 Oct 2020 12:36:13 +0100 Subject: [PATCH] fix: update snapshot with lastupdatedat --- packages/graphback-datasync/src/DataSyncPlugin.ts | 6 +----- .../tests/__snapshots__/DataSyncPlugin.test.ts.snap | 12 ++++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/graphback-datasync/src/DataSyncPlugin.ts b/packages/graphback-datasync/src/DataSyncPlugin.ts index 1b7260572d..17469734d0 100644 --- a/packages/graphback-datasync/src/DataSyncPlugin.ts +++ b/packages/graphback-datasync/src/DataSyncPlugin.ts @@ -179,7 +179,7 @@ export class DataSyncPlugin extends GraphbackPlugin { DeltaOTC.addFields({ [field.name]: field.type.toString() }) } - modelTC.addFields({ + DeltaOTC.addFields({ [DataSyncFieldNames.lastUpdatedAt]: { type: TimestampSTC.getType(), description: "@index(name: 'Datasync_lastUpdatedAt')" @@ -190,10 +190,6 @@ export class DataSyncPlugin extends GraphbackPlugin { [DataSyncFieldNames.deleted]: GraphQLBoolean }) - DeltaOTC.addFields({ - [DataSyncFieldNames.deleted]: GraphQLBoolean - }) - // Create and Add Delta List type to schema const DeltaListOTC = schemaComposer.createObjectTC({ name: getDeltaListType(modelName), diff --git a/packages/graphback-datasync/tests/__snapshots__/DataSyncPlugin.test.ts.snap b/packages/graphback-datasync/tests/__snapshots__/DataSyncPlugin.test.ts.snap index 4c4e6209c3..0801517b17 100644 --- a/packages/graphback-datasync/tests/__snapshots__/DataSyncPlugin.test.ts.snap +++ b/packages/graphback-datasync/tests/__snapshots__/DataSyncPlugin.test.ts.snap @@ -22,6 +22,9 @@ type CommentDelta { title: String description: String noteId: ID + + \\"\\"\\"@index(name: 'Datasync_lastUpdatedAt')\\"\\"\\" + _lastUpdatedAt: GraphbackTimestamp _deleted: Boolean } @@ -134,6 +137,9 @@ type NoteDelta { title: String description: String mainCommentId: ID + + \\"\\"\\"@index(name: 'Datasync_lastUpdatedAt')\\"\\"\\" + _lastUpdatedAt: GraphbackTimestamp _deleted: Boolean } @@ -241,6 +247,9 @@ type CommentDelta { title: String description: String _version: Int! + + \\"\\"\\"@index(name: 'Datasync_lastUpdatedAt')\\"\\"\\" + _lastUpdatedAt: GraphbackTimestamp _deleted: Boolean } @@ -371,6 +380,9 @@ type CommentDelta { id: ID! title: String description: String + + \\"\\"\\"@index(name: 'Datasync_lastUpdatedAt')\\"\\"\\" + _lastUpdatedAt: GraphbackTimestamp _deleted: Boolean }