# Query sever timestamps in GraphQL?

**URL:** <https://discuss.dgraph.io/t/query-sever-timestamps-in-graphql/7091>\
**Category:** GraphQL\
**Tags:** status:accepted, kind:feature\
**Created:** [June 9, 2020, 12:36pm UTC](https://discuss.dgraph.io/t/query-sever-timestamps-in-graphql/7091 "2020-06-09T12:36:25Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [June 15, 2020, 5:39pm UTC](https://discuss.dgraph.io/t/query-sever-timestamps-in-graphql/7091/5 "2020-06-15T17:39:26Z")

</div>

Is it safe to assume that the way to do this in the mean time is with custom mutations?

[https://graphql.dgraph.io/custom/mutation](https://graphql.dgraph.io/custom/mutation)

> Dgraph generates an `addPost` mutation from those types, but we want to do something extra. We don’t want the `author` to come in with the mutation, that should get filled in from the JWT of the logged in user. Also, the `datePublished` shouldn’t be in the input; it should be set as the current time at point of mutation. Maybe we also have some community guidelines about what might constitute an offensive `title` or `text` in a post. Maybe users can only post if they have enough community credit.
> 
> We’ll need custom code to do all that, so we can write a custom function that takes in only the title and text of the new post. Internally, it can check that the title and text satisfy the guidelines and that this user has enough credit to make a post. If those checks pass, it then builds a full post object by adding the current time as the `datePublished` and adding the `author` from the JWT information it gets from the forward header. It can then call the `addPost` mutation constructed by Dgraph to add the post into Dgraph and returns the resulting post as its GraphQL output.

---

_[View the full topic](https://discuss.dgraph.io/t/query-sever-timestamps-in-graphql/7091)._
