https://www.theitsolutions.io/blog/how-to-add-custom-graphql-query-to-strapi-v4
https://forum.strapi.io/t/graphql-custom-resolver-in-v4/13506
Are GraphQL queries supposed to trigger controller actions in Strapi v4?
https://strapi.io/blog/extending-and-building-custom-resolvers-with-strapi-v4
register({ strapi }) {
const extensionService = strapi.plugin('graphql').service('extension');
const extension = ({}) => ({
typeDefs: `
type YourType {
customResolver: [OtherType!]!
}
`,
resolvers: {
YourType: {
customResolver: async (parent, args) => {
const entries = await strapi.entityService.findMany('api::other-type.other-type', {});
return entries;
}
}
}
})
Top comments (0)