Skip to content

Allow interfaces to be mapped as types or inputs#939

Merged
phillip-kruger merged 1 commit intosmallrye:mainfrom
phillip-kruger:main
Aug 2, 2021
Merged

Allow interfaces to be mapped as types or inputs#939
phillip-kruger merged 1 commit intosmallrye:mainfrom
phillip-kruger:main

Conversation

@phillip-kruger
Copy link
Copy Markdown
Member

Fix #926

Signed-off-by:Phillip Kruger phillip.kruger@gmail.com

Signed-off-by:Phillip Kruger <phillip.kruger@gmail.com>
@phillip-kruger phillip-kruger added this to the 1.3.1 milestone Aug 2, 2021
@phillip-kruger phillip-kruger merged commit c344855 into smallrye:main Aug 2, 2021
@robp94
Copy link
Copy Markdown
Contributor

robp94 commented Sep 1, 2021

@phillip-kruger How would you use interfaces as input?

@phillip-kruger
Copy link
Copy Markdown
Member Author

@robp94 from the client or the server ?

@robp94
Copy link
Copy Markdown
Contributor

robp94 commented Sep 1, 2021

@phillip-kruger
Copy link
Copy Markdown
Member Author

So are you asking how you would know what the concrete class is ?

@robp94
Copy link
Copy Markdown
Contributor

robp94 commented Sep 1, 2021

When I add a mutation to the linked api like this:

    @Mutation
    public Eatable inputEatable(Eatable eatable) {
        return eatable;
    }

I get the following error
Class org.acme.Eatable is used as input, but does neither have a public default constructor nor a JsonbCreator method

I don't see how to provide an JsonBCreator at the interface, for example, like what the concrete class is. Could you provide an example in the test, or is this not supported, and I misunderstood the pull request?

@phillip-kruger
Copy link
Copy Markdown
Member Author

mmm, so the schema generate ok (that is what this PR did) but it fails at runtime ? Please open a bug, referencing this and if possible add a reproducer.

@robp94
Copy link
Copy Markdown
Contributor

robp94 commented Sep 1, 2021

Quarkus fails to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java interface should only be mapped to GraphQL interface if @Interface is annotated

2 participants