populate-customers.ts 625 B

1234567891011121314
  1. import { VendureConfig } from '../src/config/vendure-config';
  2. import { MockDataService } from './mock-data.service';
  3. import { SimpleGraphQLClient } from './simple-graphql-client';
  4. /**
  5. * Creates customers with addresses by making API calls to the Admin API.
  6. */
  7. export async function populateCustomers(count: number, config: VendureConfig, logging: boolean = false) {
  8. const client = new SimpleGraphQLClient(`http://localhost:${config.port}/${config.adminApiPath}`);
  9. await client.asSuperAdmin();
  10. const mockDataService = new MockDataService(client, logging);
  11. await mockDataService.populateCustomers(count);
  12. }