@jackchuka/gql-ingest 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bin/cli.js +38 -38
  2. package/package.json +1 -1
  3. package/src/cli.ts +4 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackchuka/gql-ingest",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "A CLI tool for ingesting data from CSV files into a GraphQL API",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
package/src/cli.ts CHANGED
@@ -122,7 +122,9 @@ program
122
122
  // When using --entities flag, show warnings instead of errors
123
123
  console.warn("\n⚠️ Warning: Dependency validation issues:");
124
124
  validationErrors.forEach((error) => console.warn(` - ${error}`));
125
- console.warn("This may cause errors if the dependent data doesn't already exist.\n");
125
+ console.warn(
126
+ "This may cause errors if the dependent data doesn't already exist.\n"
127
+ );
126
128
  } else {
127
129
  // Strict validation when processing all entities
128
130
  console.error("Dependency validation errors:");
@@ -131,12 +133,7 @@ program
131
133
  }
132
134
  }
133
135
 
134
- // Process entities in dependency-aware waves
135
- if (config.parallelProcessing.entityConcurrency === 1) {
136
- await processEntitiesSequentially(mappingPaths, mapper, config);
137
- } else {
138
- await processEntitiesInWaves(mappingPaths, resolver, mapper, config);
139
- }
136
+ await processEntitiesInWaves(mappingPaths, resolver, mapper, config);
140
137
 
141
138
  metrics.finishProcessing();
142
139
  console.log(metrics.generateSummary());
@@ -146,23 +143,6 @@ program
146
143
  }
147
144
  });
148
145
 
149
- async function processEntitiesSequentially(
150
- mappingPaths: string[],
151
- mapper: DataMapper,
152
- config: ReturnType<typeof loadConfig>
153
- ): Promise<void> {
154
- for (const configPath of mappingPaths) {
155
- try {
156
- const entityName = basename(configPath, ".json");
157
- const entityConfig = getEntityConfig(entityName, config);
158
- const retryConfig = getRetryConfig(entityName, config);
159
- await mapper.processEntity(configPath, entityConfig, retryConfig);
160
- } catch (error) {
161
- console.warn(`Warning: Could not process ${configPath}:`, error);
162
- }
163
- }
164
- }
165
-
166
146
  async function processEntitiesInWaves(
167
147
  mappingPaths: string[],
168
148
  resolver: DependencyResolver,