Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

automatically set dcterms:created and dcterms:modified when mutations are made #112

Closed
alastair opened this issue Mar 24, 2020 · 3 comments
Labels
discuss enhancement New feature or request

Comments

@alastair
Copy link
Member

In some of our types (e.g. Annotation) we want to know when the annotation was made, and if it was changed, when it was changed.
To store this, we have 2 fields, created and modified.
There are 2 ways we can fill these fields. One is to require the client to set them (we can make created required in this case). A problem here is that modified would have to be non-required (and only set when an item is Updated?). Also, it means that a client could change created by sending an Updated mutation.
The other option is to make the CE automatically set the created field on a Create mutation, and set modified on an Update mutation. We would have to decide which types we want this behaviour on. Can we think of a situation when we might want to override this behaviour when creating an object?

@ChristiaanScheermeijer
Copy link
Collaborator

This feature would make this really easy:

neo4j-graphql/neo4j-graphql-js#364

@ChristiaanScheermeijer
Copy link
Collaborator

My preference is to fill these fields automatically as almost any other API does.

@alastair
Copy link
Member Author

That sounds like a nice solution. How much work do you think it is to push this PR along to get it merged into an upcoming release?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discuss enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants