@fraym/crud 0.3.0 → 0.3.1
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.
- package/README.md +5 -0
- package/dist/cmd/crud.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,11 @@ Client implementation in javascript for the CRUD service [streams](https://githu
|
|
|
8
8
|
npm i @fraym/crud
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## GraphQL
|
|
12
|
+
|
|
13
|
+
You can access the graphQL api at `http://crud:3000/delivery/graphql`.
|
|
14
|
+
There is a sandbox available at `http://crud:3000/delivery/graphql/sandbox`.
|
|
15
|
+
|
|
11
16
|
## CLI command
|
|
12
17
|
|
|
13
18
|
Use the `crud` cli command to automatically apply your crud schemas to the crud service.
|
package/dist/cmd/crud.js
CHANGED
|
@@ -200,19 +200,19 @@ const migrateSchemas = async (definitions, serverAddress) => {
|
|
|
200
200
|
nestedTypesToCreate.push(nestedTypeName);
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
|
-
if (
|
|
204
|
-
console.log(`
|
|
205
|
-
await managementClient.
|
|
206
|
-
console.log(`
|
|
203
|
+
if (typesToCreate.length > 0) {
|
|
204
|
+
console.log(`Creating ${typesToCreate.length} types: ${typesToCreate}...`);
|
|
205
|
+
await managementClient.createTypes(createSchema).catch(console.log);
|
|
206
|
+
console.log(`Created ${typesToCreate.length} types`);
|
|
207
207
|
}
|
|
208
208
|
if (typesToUpdate.length > 0) {
|
|
209
209
|
console.log(`Updating ${typesToUpdate.length} types: ${typesToUpdate}...`);
|
|
210
210
|
await managementClient.updateTypes(updateSchema).catch(console.log);
|
|
211
211
|
console.log(`Updated ${typesToUpdate.length} types`);
|
|
212
212
|
}
|
|
213
|
-
if (
|
|
214
|
-
console.log(`
|
|
215
|
-
await managementClient.
|
|
216
|
-
console.log(`
|
|
213
|
+
if (typesToRemove.length > 0) {
|
|
214
|
+
console.log(`Removing ${typesToRemove.length} types: ${typesToRemove}...`);
|
|
215
|
+
await managementClient.removeTypes(typesToRemove).catch(console.log);
|
|
216
|
+
console.log(`Removed ${typesToRemove.length} types`);
|
|
217
217
|
}
|
|
218
218
|
};
|