Alexandre Bodin 0285c7bd96 Add metadatas to resolvers to know where they are created
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-02-10 21:38:37 +01:00

39 lines
1.1 KiB
JavaScript

module.exports = {
query: `
customQuery: String
customQuery2: String
restaurantByAddress: Homepage
q1: Homepage
`,
resolver: {
Query: {
customQuery: {
policies: [], // consider that the local policies are in the api which is created this file
resolverOf: 'application::restaurant.restaurant.find',
resolver() {},
},
customQuery2: {
policies: [], // consider that the local policies are in the api which is created this file
resolver: 'application::restaurant.restaurant.find',
},
restaurantByAddress: {
policies: [], // consider that the local policies are in the api which is created this file
resolverOf: 'application::address.address.find',
resolver: 'application::homepage.homepage.find',
},
q1: {
policies: ['test'],
resolverOf: 'application::restaurant.restaurant.find',
resolver(root, args, ctx) {
return {
id: 1,
title: 'coucou',
};
},
},
},
},
};