Skip to content

How to wrap MethodFieldResolverDataFetcher without ResolverError? #536

Answered by jaeyeolshin
jaeyeolshin asked this question in Q&A
Discussion options

You must be logged in to vote

I fount it's possible to figure out the type of field that is supposed to be returned by the original data fetcher(MethodFieldResolverDataFatcher) using reflection, but it's tricky.
My original purpose was returning an error when inactive users call the API. Because we're currently using errors field in response types, we need to know the type to build an instance of it. I just realized that if we use standard errors field in graphql response, we don't need to hack for instantiating an unknown result type like UpdateResult or CreateResult. We just need to implement an GraphQLErrorHandler to fill proper standard errors field.
So.. my question is self answered. Thanks :)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jaeyeolshin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant