In the Apollo Server documentation, it describes the behaviour of the default resolver, which is quite handy.
I also gathered from somewhere else (another SO question if I recall), that you can override the default resolver function with your own, by passing a fieldResolver function into the options for the apollo-server instance:
const server = new ApolloServer({ typeDefs, resolvers,
fieldResolver: function (source, args, context, info) {
console.log("Field resolver triggered!")
return null;
}
});
What I would like to do is augment the default behaviour, rather than overriding it. Specifically, I am integrating with a REST API that returns fields in snake_case, whereas my schema is attempting to follow the advised convention of using camelCase for field names. I would like to wrap this field name conversion around the default resolver behaviour, rather than having to re-write it.
Alternatively, if somebody can point me to the source location for the default resolver implementation, I'd be happy enough to take that and adapt it either!