impress-2020/src/server/lib/beeline-graphql.js
Matchu 19482be2b8 Use ES module syntax in backend instead of require
Ok cool, so apparently another win we get from using `ts-node` is that I can finally easily use some non-native-Node features like ES module import syntax, for consistency with what I'm doing in the main app source! That was getting on my nerves tbh. Ooh I bet I can finally use `?.` too, I've had to rewrite that a bunch…
2021-02-02 22:26:55 -08:00

22 lines
437 B
JavaScript

import beeline from "honeycomb-beeline";
const beelinePlugin = {
requestDidStart() {
const trace = beeline.startTrace();
return {
didResolveOperation({ operationName }) {
beeline.addContext({
name: operationName,
operation_name: operationName,
});
},
willSendResponse() {
beeline.finishTrace(trace);
},
};
},
};
module.exports = {
beelinePlugin,
};