-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Unable to use Panache Sort.Direction enum as method parameter for GraphQL query #36688
Comments
/cc @FroMage (panache), @jmartisk (graphql), @loicmathieu (panache), @phillip-kruger (graphql) |
When using classes from a dependency inside your graphql api, that dependency must be explicitly added to the index (with few exceptions)
|
It looks like an usage that could be common, I'm thinking we could add this enum to the index automatically. |
Yeah that makes sense I guess. @mskacelik will create a PR with that |
@mskacelik the idea would be to use |
Why in Panache? Don't we want this in GraphQL, because it's most likely needed because of using it inside a GraphQL api? |
I'm not sure if we have a capability for Panache but if we have one (or if you feel like adding one) then yes we can do it in |
@jmartisk Thanks, this did the trick. Do you think there is value in adding a note to the SmallRye GraphQL guide on this? Happy to provide a PR. |
@gsmet There are capabilities for @mzuber we could add something to additional notes (https://quarkus.io/guides/smallrye-graphql#additional-notes), probably not specifically about Panache, but more generally about using stuff from dependencies. This specific case might go away if we really start adding that enum into the index automatically. |
I don't think GraphQL needs this info ? Maybe the fix is the GraphQL just ignore the error ? If possible ? |
Well, can it work with this error? What does the graphql look like if the error is ignored? If that causes the method to be ignored, that's probably not what we want, no? |
It's typically something that could be used as a parameter. Fixes quarkusio#36688
I created #45298 as it's a quick win. |
Describe the bug
Using the
Sort.Direction
enum from thequarkus-hibernate-orm-panache
extension as a method parameter for a GraphQL query defined with thequarkus-smallrye-graphql
extension results in a startup failure when Quarkus tries to generate the schema of the exposed GraphQL API at application startup:Expected behavior
It is possible to use the
Sort.Direction
enum from thequarkus-hibernate-orm-panache
as a method parameter for a GraphQL query.Actual behavior
The
quarkus-smallrye-graphql
extension is unable to generate the schema of the exposed GraphQL API at application startup. Before the startup failure the warningClass [io.quarkus.panache.common.Sort$Direction] is not indexed in Jandex. Can not scan Object Type, might not be mapped correctly. Kind = [CLASS]
is logged.How to Reproduce?
In a Quarkus application using both the
quarkus-hibernate-orm-panache
and thequarkus-smallrye-graphql
extension, define a GraphQL API using theSort.Direction
enum in a query definition:Output of
uname -a
orver
No response
Output of
java -version
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment GraalVM CE 17.0.7+7.1 (build 17.0.7+7-jvmci-23.0-b12)
OpenJDK 64-Bit Server VM GraalVM CE 17.0.7+7.1 (build 17.0.7+7-jvmci-23.0-b12, mixed mode, sharing)
Quarkus version or git rev
3.4.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.3
Additional information
No response
The text was updated successfully, but these errors were encountered: