-
Notifications
You must be signed in to change notification settings - Fork 317
Support multiple typeNames on @SchemaMapping and @BatchMapping #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple typeNames on @SchemaMapping and @BatchMapping #236
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
typeName
s on mapping annotations. The use-case for why this may be a helpful inclusion set out in the attached issue.