Hi, I have the following set up to obtain an aggregated query in Mongo as part of a Graphql resolver:
return collection.rawCollection().aggregate([
{ $match : { charID: args.charID } },
{ $unwind : "$enemies" },
{ $match : { "enemies.name" : args.name } }
]))
This is the error thrown in GraphiQL: Cannot return null for non-nullable field collection.charID.
Take note that my data exists, the query works in Robo3T, and there isn’t an issue with my GraphQL schemas or anything of that sort. When I console log this entire object I see that it’s an Aggregation Cursor. How do I go about “converting” this back into something readable in Meteor’s context? .fetch() and .toArray have not worked thus far, and I’m not sure how to get around this.
Thanks!