-
Notifications
You must be signed in to change notification settings - Fork 320
Support for @SchemaMapping and @BatchMapping based off interface type #294
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
Comments
Attached is a simple project that hopefully explains this in more detail |
As far as I can see this is the same discussion as #236. One additional thought is to check if @QueryMapping(name = "userGet")
fun userGet(@Argument(name = "username") username: String, fieldSelectionSet: DataFetchingFieldSelectionSet): User? {
if (fieldSelectionSet.contains("color")) {
// ...
}
// ...
} |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Superseded by #871. |
Uh oh!
There was an error while loading. Please reload this page.
I'm having a hard time registering a
@SchemaMapping
function that should be used as a data fetcher for all subclasses for an interface.Given the example schema:
And the following Kotlin model:
My expectation is that by defining a schema mapping for the
User
interface I would be able to register a data fetcher for thecolor
field on allUser
subclasses.However in this example the following query:
Results in an exception.
Registering a
@SchemaMapping
for both concrete types (PurpleUser and GreenUser) fixes this issue.Is it possible to configure this in a way to avoid duplication of mapping annotations across concrete subtypes? I've included a sample project that demonstrates this issue.
The text was updated successfully, but these errors were encountered: