Schema Extensions: How to transform result to returnType using a resolver? #7960
greenGizmo
started this conversation in
Docs Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to extend my schema using the
@resolveTo
directive. It works so far, that the underlying source is called with the correct params and I get the expected result. The problem is, that the response I get is not the same type as the type that should be returned. So I have to run a mapper or transformer between these two types. The documentation mentions that this is possible using a resolver:https://the-guild.dev/graphql/mesh/v1/schema-extensions#basic-example
What is missing is how to implement that resolver. I already tried to implement
additionalResolvers
in my gateway (hive), but as soon as I use@resolveTo
in my schema these are ignored and not called anymore.I think there should be an example or a page dedicated to
@resolveTo
to explain such scenarios. In v0 it was possible to reference a resolver for theextend
transform (https://the-guild.dev/graphql/mesh/docs/transforms/extend) which is now missing.Beta Was this translation helpful? Give feedback.
All reactions