You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Caused by: java.lang.IllegalArgumentException: value already present: my.package.MyEntity
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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