can i get requested fields in resolve
sunhaolin opened this issue · comments
I found a npm package graphql-parse-resolve-info to parses a GraphQLResolveInfo object into a tree of the fields.
May be in createActionResolver
method , add resolveInfo
as the fourth param behind root, args, context
,
moleculer-apollo-server/src/service.js
Lines 152 to 162 in 7f0e2e2
And then passed as meta to action, return await context.ctx.call(actionName, mergedParams, { meta: { resolveInfo } });
moleculer-apollo-server/src/service.js
Line 254 in 7f0e2e2
@sunhaolin Since createActionResolver
is a mixin method, you can provide your own definition and behavior for what it does. essentially you can override it to have the implementation you are looking for without a need to modify moleculer-apollo-server
. Please try that out and see if it works for you.
@shawnmcknight works fine, thank you very mach!