The idea is that we wrap all user resolvers with a single framework resolver that looks after our framework level stuff (such as audit logging and resolver metrics) in the exact order we want, and it simply calls the user resolver somewhere in there. It's a rough idea but the steps would be something like this.
``` {code} function voyagerResolver(obj, args, context, info) { // initialise the resolver timing counter // call user level resolver // audit log of resolver details, failure, success etc. // collect and update resolver timing metrics // return } ``` {code}
This function should be pretty simple and it should be placed inside the apollo-voyager-server package. The users resolvers should be wrapped up as part of server creation without the user needing to do any additional work. |
|