Support multiple typeNames on @SchemaMapping and @BatchMapping#236
Support multiple typeNames on @SchemaMapping and @BatchMapping#236francis-a wants to merge 1 commit intospring-projects:mainfrom francis-a:multiple-typenames-query-mapping
Conversation
|
@francis-a Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
|
@francis-a Thank you for signing the Contributor License Agreement! |
|
DGS does not do this https://netflix.github.io/dgs/datafetching/#the-dgsdata-dgsquery-dgsmutation-and-dgssubscription-annotations NestJS does not do this https://docs.nestjs.com/graphql/resolvers I am also afraid of the added complexity and how tooling would implement this, GraphQL Java also does not implement such a feature Adding a second SchemMapping is just a copy+paste action and also gives the added ability to use security optimally |
|
Sorry for the delayed response. I can't say I completely understand the scenario, nor why exactly it doesn't work, at least not without a sample to run. That said, I can say we don't really want to change the annotation attributes to support a use case that's a bit difficult to explain, and may open up other unexpected possibilities. For a one-off case, declaring multiple |
|
Hi @rstoyanchev I totally understand your point. Let me try to describe my use-case a bit more in-case it's helpful. Generally using multiple mapping annotations does work and is a fair tradeoff. Given the following Schema To go along with this we have the following Kotlin model. Hopefully this example makes the use-case a bit more clear. |
|
How often does that realistically happen for it to warrant such a feature? More importantly: |
|
I'm also not quite sure why it is a union when the two types already have a common parent interface. In any case, thanks for elaborating. We'll leave at that for now. We can always reconsider if this gathers more interest or more uses cases emerge. |
We're facing the same issue in a large collection of interfaces. Any workarounds? |
|
We are encountering the same problem. |
Pretty much anytime you use an interface in your GraphQL schema. |
|
This is now superseded by #871. |
GitHub issue: #235
This draft aims to provide a simple sketch for supporting multiple
typeNames on mapping annotations. The use-case for why this may be a helpful inclusion set out in the attached issue.