mirror of
https://github.com/Ratstail91/sineQL.git
synced 2025-11-28 18:24:28 +11:00
Added a field filter
This commit is contained in:
@@ -70,6 +70,13 @@ const queryHandlers = {
|
||||
//for each author, update this non-scalar field with the non-scalar's recursed value
|
||||
authorResults = authorResults.map(author => {
|
||||
author[nonScalar] = nonScalarArray.filter(ns => ns['authorId'] == author.id);
|
||||
|
||||
//BUGFIX: filter out extra authorId
|
||||
author[nonScalar] = author[nonScalar].map(ns => {
|
||||
const { authorId, ...res } = ns;
|
||||
return res;
|
||||
}); //extract authorId
|
||||
|
||||
return author;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user