You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
disclosure: I don't have a running instance of PrimeCMS, but I've been extensively pouring through the code for the last few days.
When looking at your generated resolvers for the Document mutations, I came across the createDocumentUpdateResolver, which as I understand it creates the update$SCHEMA mutation for the GraphQL API. This mutation should simply update a field in a document (as I understand it)
Notably, this is separate from the create$SCHEMA endpoint which uses the createDocumentCreateResolver, which creates a new document for a given schema.
My question: In both resolvers you use the repositort.insert on your Document TypeORM repository instance. According to TypeORM, the insert( ... ) call always creates a new row/record without checking if the entity already exists.
So does PrimeCMS constantly keep inserting full duplicates of a Document whenever you update something? Is this to support versioning? I have a suspicion it is since in the DocumentResolver you use FindOne and order it by DESC on the created_at field but wanted to check with you.
Thanks for reading. Really great project and codebase! I'm getting lots of inspiration from it.
The text was updated successfully, but these errors were encountered:
disclosure: I don't have a running instance of PrimeCMS, but I've been extensively pouring through the code for the last few days.
When looking at your generated resolvers for the Document mutations, I came across the
createDocumentUpdateResolver
, which as I understand it creates the update$SCHEMA mutation for the GraphQL API. This mutation should simply update a field in a document (as I understand it)Notably, this is separate from the create$SCHEMA endpoint which uses the
createDocumentCreateResolver
, which creates a new document for a given schema.My question: In both resolvers you use the
repositort.insert
on your Document TypeORM repository instance. According to TypeORM, theinsert( ... )
call always creates a new row/record without checking if the entity already exists.So does PrimeCMS constantly keep inserting full duplicates of a Document whenever you update something? Is this to support versioning? I have a suspicion it is since in the
DocumentResolver
you useFindOne
and order it byDESC
on the created_at field but wanted to check with you.Thanks for reading. Really great project and codebase! I'm getting lots of inspiration from it.
The text was updated successfully, but these errors were encountered: