How to map different schema types to the same entity? #769
Unanswered
arquadrado
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
-
Hello,
I have a use case that I am failing to convert to an implementation that satisfies me and I am wondering if I am missing something.
Here's the use case:
I have a single entity with several fields that I want to expose through different graphql types, e.g. GraphQLTypeA has MyEntity fields A and B and GraphQLTypeB has MyEntity fields A, B and C.
It seems to me pretty straight forward but the truth is that I am encountering a lot of difficulties.
I tried to achieve this by using the resolver with different resolver methods and I tried to create a specific for each type but every time I encounter the problem:
The only way that I see that could solve this was to create two different java entities to map to the different types but that solution seems far from clean as it adds complexity and requires some code duplication.
Any ideas on what I might be missing?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions