cool-data-manager
Advanced tools
Comparing version 1.0.16 to 1.0.17
{ | ||
"name": "cool-data-manager", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "", | ||
@@ -12,2 +12,3 @@ "main": "index.js", | ||
"fbkt-clog": "^1.0.1", | ||
"get-graphql-schema": "^1.0.1", | ||
"lokka": "^1.7.0" | ||
@@ -14,0 +15,0 @@ }, |
@@ -45,5 +45,7 @@ const Promise = require('bluebird'); | ||
return buildRelationOrCollectionOutputList(fieldName, field.type, options, acc); | ||
} else { | ||
} else if (field.queryExclude !== true) { | ||
return Promise.resolve(acc.concat(` ${fieldName}, | ||
`)); | ||
} else { | ||
return Promise.resolve(acc); | ||
} | ||
@@ -50,0 +52,0 @@ }, |
@@ -0,1 +1,3 @@ | ||
const CoolRelation = require('../coolRelation'); | ||
const ClientWrapper = require('./clientWrapper'); | ||
@@ -10,5 +12,34 @@ const CreateOne = require('./createOne'); | ||
function processEntityInfo(entityInfo){ | ||
const fields = Object.keys(entityInfo.fields).reduce( | ||
(acc, fieldName) => { | ||
if (entityInfo.fields[fieldName].type instanceof CoolRelation) { | ||
return Object.assign(acc, { | ||
[fieldName]: entityInfo.fields[fieldName], | ||
[`${fieldName}Id`]: { | ||
type: 'string', | ||
queryExclude: true | ||
} | ||
}) | ||
} else { | ||
return Object.assign(acc, { | ||
[fieldName]: entityInfo.fields[fieldName] | ||
}) | ||
} | ||
}, | ||
{} | ||
); | ||
return { | ||
entityName: entityInfo.entityName, | ||
entityNamePlural: entityInfo.entityNamePlural, | ||
fields: fields | ||
}; | ||
} | ||
class CoolDataManager{ | ||
constructor(entityInfo, client, options){ | ||
this.entityInfo = entityInfo; | ||
this.entityInfo = processEntityInfo(entityInfo); | ||
clog('THIS ENTITYINFO', this.entityInfo); | ||
this.client = new ClientWrapper(client, options); | ||
@@ -15,0 +46,0 @@ } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
580310
34
21107
4
1
+ Addedget-graphql-schema@^1.0.1
+ Added@types/graphql@0.8.6(transitive)
+ Added@types/node@7.10.14(transitive)
+ Added@types/node-fetch@1.6.9(transitive)
+ Addedencoding@0.1.13(transitive)
+ Addedget-graphql-schema@1.0.1(transitive)
+ Addedgraphql@0.9.6(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addediterall@1.3.0(transitive)
+ Addednode-fetch@1.7.3(transitive)
+ Addedsafer-buffer@2.1.2(transitive)