System Information
- Strapi Version: v3
- Operating System: Zorin OS 16.1
- Database: MySQL
- Node Version: 14.16.0
- NPM Version: 8.5.5
- Yarn Version: 1.22.17
Hello!
I would like to be able to manipulate the data before returning the result but I am not able to find the best way to do this, I imagined that the result of the query would come in the context object.
module.exports = {
definition: ``,
query: `
customPortfolio(id: ID): Portfolio!
`,
type: {},
resolver: {
Query: {
customPortfolio: {
description: "returns a portfolio by id",
resolverOf:
"application::medcel-v6-portfolios.medcel-v6-portfolios.find",
resolver: (obj, options, { context }) => {
// handle query result here
return [
{ name: "manipulated result" }
]
}
},
},
Mutation: {},
},
};