Cleanup graphql

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-02-10 11:57:06 +01:00
parent 3f5f839b4c
commit 04476e32a6
2 changed files with 6 additions and 50 deletions

View File

@ -1,38 +0,0 @@
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',
};
},
},
},
},
};

View File

@ -160,19 +160,13 @@ const generateSchema = () => {
return {};
}
const queryFields = formatGQL(
shadowCRUD.query,
resolver.Query,
null,
'query'
);
const queryFields =
shadowCRUD.query &&
formatGQL(shadowCRUD.query, resolver.Query, null, 'query');
const mutationFields = formatGQL(
shadowCRUD.mutation,
resolver.Mutation,
null,
'mutation'
);
const mutationFields =
shadowCRUD.mutation &&
formatGQL(shadowCRUD.mutation, resolver.Mutation, null, 'mutation');
const scalars = Types.getScalars();