Description
Describe the bug
Graphql schema generation adds a type subfix (like "_Int") at the generated schema type names.
I have following classes (taken from SmallRye GraphQL extension guide)
public class Id<T> {
public T id;
}
public class Film extends Id<Integer> {
public String title;
public Integer episodeID;
public String director;
public LocalDate releaseDate;
}
Accessing the schema through the introspect gives not the expected schema.
Expected behavior
Output of Introspect:
type Film {
director: String
episodeID: Int
id: Int
"ISO-8601"
releaseDate: Date
title: String
}
"Query root"
type Query {
"Get all Films from a galaxy far far away"
allFilms: [Film]
}
Actual behavior
Output of Introspect:
type Film_Int {
director: String
episodeID: Int
id: Int
"ISO-8601"
releaseDate: Date
title: String
}
"Query root"
type Query {
"Get all Films from a galaxy far far away"
allFilms: [Film_Int]
}
How to Reproduce?
I have created a small reproducer: https://github.com/daviddavidgit/quarkus-simple-graphql-schema-generation
It is based on: https://quarkus.io/guides/smallrye-graphql
Output of uname -a
or ver
Linux david-ThinkPad-X1-Extreme-Gen-3 5.14.0-1051-oem #58-Ubuntu SMP Fri Aug 26 05:50:00 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version "11.0.16" 2022-07-19 OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu122.04) OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.10.0
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.8.6
Additional information
With Quarkus 2.9.0 it still worked.
With Quarkus 2.12.3 it does not work.
The problem might be in the SchemaPrinter of graphql-java.