@accounter/server
Version:
The test suite is split into three Vitest projects for efficiency and isolation:
24 lines • 879 B
JavaScript
import { GraphQLError } from 'graphql';
import { ChargesMatcherProvider } from '../providers/charges-matcher.provider.js';
export const findChargeMatchesResolver = {
Query: {
findChargeMatches: async (_, { chargeId }, context) => {
try {
const result = await context.injector
.get(ChargesMatcherProvider)
.findMatchesForCharge(chargeId, context);
return result;
}
catch (e) {
if (e instanceof GraphQLError) {
throw e;
}
const message = e?.message ??
e?.errors.map(e => e.message).toString() ??
'Unknown error';
throw new GraphQLError(message);
}
},
},
};
//# sourceMappingURL=find-charge-matches.resolver.js.map