mirror of
https://github.com/strapi/strapi.git
synced 2025-08-27 18:25:49 +00:00
Cleanup graphql
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
3f5f839b4c
commit
04476e32a6
@ -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',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
@ -160,19 +160,13 @@ const generateSchema = () => {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryFields = formatGQL(
|
const queryFields =
|
||||||
shadowCRUD.query,
|
shadowCRUD.query &&
|
||||||
resolver.Query,
|
formatGQL(shadowCRUD.query, resolver.Query, null, 'query');
|
||||||
null,
|
|
||||||
'query'
|
|
||||||
);
|
|
||||||
|
|
||||||
const mutationFields = formatGQL(
|
const mutationFields =
|
||||||
shadowCRUD.mutation,
|
shadowCRUD.mutation &&
|
||||||
resolver.Mutation,
|
formatGQL(shadowCRUD.mutation, resolver.Mutation, null, 'mutation');
|
||||||
null,
|
|
||||||
'mutation'
|
|
||||||
);
|
|
||||||
|
|
||||||
const scalars = Types.getScalars();
|
const scalars = Types.getScalars();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user