Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
export class SequelizeCustomerLoader implements CustomerLoader {
async get(id: string): Promise<Customer> {
const customers = await SequelizeCustomerModel
where: { id: id },
limit: 1
return customers[0] || Promise.reject(new CustomerNotFoundError())
private mapToCustomers(customers: SequelizeCustomerModel[]): Customer[] {
return => new Customer(,,,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment