|
@@ -80,12 +80,9 @@ function mmExpandSchema(gqlSchema){
|
|
|
type: GraphQLInt,
|
|
|
args: {query: {type: GraphQLString}},
|
|
|
async resolve(root, args, context, info){
|
|
|
- q = JSON.parse(args.query)
|
|
|
- q[1] = q[1] || {}
|
|
|
- q[1].count = []
|
|
|
- console.log(q)
|
|
|
- args.query = JSON.stringify(q)
|
|
|
- return find.resolve(root, args, context, info)
|
|
|
+ const Savable = context.models.SlicedSavable || context.models.Savable
|
|
|
+ args = JSON.parse(args.query)
|
|
|
+ return await Savable.m[outputTypeName].count(...args)
|
|
|
}
|
|
|
}
|
|
|
queryFields[`${outputTypeName}Count`] = count
|