Skip to content
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

Add support for public fields instead of getters #1026

Closed
mswiderski opened this issue Sep 9, 2021 · 4 comments
Closed

Add support for public fields instead of getters #1026

mswiderski opened this issue Sep 9, 2021 · 4 comments

Comments

@mswiderski
Copy link

When using beans that are returned from GraphQL services that use only public fields instead of java bean approach (getters/setters) then there is a DataFetchException returned for every path that targets beans without getters and setters.

Would be really good to have support for beans with public fields as this becomes more and more common.

Unless I missed some sort of configuration that enables that.

Using smallrye-graphql version 1.3.1 through quarkus 2.2.1

@phillip-kruger
Copy link
Member

phillip-kruger commented Sep 9, 2021

Are these also panache entities ? If so, there was a bug w.r.t that, that is now fixed (quarkusio/quarkus#19883). If not, then this is an issue, as we do support public fields.

@mswiderski
Copy link
Author

yes, indeed it is panache entity. so I guess it's good to be closed as 2.3 of quarkus will come with the fix. thanks @phillip-kruger

@phillip-kruger
Copy link
Member

Great ! Closing here then

@phillip-kruger
Copy link
Member

For your interest: When a panache bean builds, all fields are changed to protected, and getters/setters are added. So the issue was that GraphQL build a model, that wants to execute using the field, but then on runtime the fields are not accessible. So the fix was to update the Jandex index with the modified panache entities, before building the GraphQL mode.

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

No branches or pull requests

2 participants