Implement custom JS resolvers in GraphQL

Coming back around to this to explain in detail. I think it could be doable from what I am seeing so far in the RFC, depending on one factor.

schema:

type User {
  username: String! @id
  isActive: Boolean!
}

So I know that the pre hook would not have access to the uid from dgraph, because the request has not hit Badger yet to get the uid.

What I am looking to do for reasons not fully explained here, is to have the uid available in the post hook. In the translation of the GQL to DQL the uid is within reach very easily. What would be nice is if it was able to send it through to the post hook.

More about use case: I want to be able to do some RDF set script for view/edit history tracking upon certain actions taking place by the post hook. Having a uid would make the links easier to build then needing to do an upsert to get the uid in the post script. It would just seem like extra work when a uid was so close already.

And to sum up my idea with a relative thought, would it be possible to do an asynchronous action in a post script that the post script does not wait until it is completed to return to the user?

Using the example above, I would want to send the mutation with RDF set, but don’t really care on waiting for that to return completed before returning the response to the user. I know it is talking about really small wait times, but every microsecond matters. I know javascript will handle it, I guess just checking if there will be a hard kill on any pending processes on return.