Transforming Custom Input Type to Another Type in Middleware #2824
Unanswered
islamaliev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a GraphQL API where I have a custom input type, let's call it
SpecialType
. This type is used in various parts of the schema, particularly in mutations. The idea is to collect all theseSpecialType
inputs, process them through a specialized service, and then convert them to a string ID. This string ID should then be passed to the resolvers.Here's a simplified schema to illustrate:
I want to handle this transformation in a middleware so that the resolvers are completely unaware of the SpecialType and the specialized service. They should only receive the string ID.
I've tried using
HandlerExtension
andFieldMiddleware
, but it's becoming complex and I'm not sure if it will work as expected.I presume that I will need to create a custom plugin that alters a bit generation of golang code for the
SpecialType
.Questions:
SpecialType
inputs before they reach the resolver?Any guidance would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions