Closed abeggchr closed 1 year ago
Reproduction repository: https://github.com/abeggchr/smallrye-grapqhql-expose-types
You need to explicitly tell Quarkus to add that dependency to the application index. Add this to your application.properties
:
quarkus.index-dependency.math3.group-id=org.apache.commons
quarkus.index-dependency.math3.artifact-id=commons-math3
Let me know if this helps
I'll close this issue now as the solution was explained, please let me know if you have further questions
I can confirm that this worked. Thanks a lot.
How can types from dependent libraries or projects be exposed with smallrye-graphql? Currently I am getting the error message "type ... not found in schema".
Reproduce
quarkus create app org.acme:microprofile-graphql-quickstart --extension=quarkus-smallrye-graphql --no-code --gradle
build.gradle
to have dependencyimplementation 'org.apache.commons:commons-math3:3.3'
src/main/java/Resource.java
with content:@GraphQLApi public class Resource {
}
Caused by: java.lang.RuntimeException: Failed to start quarkus at io.quarkus.runner.ApplicationImpl.(Unknown Source)
... 15 more
Caused by: graphql.AssertException: type ConfidenceInterval not found in schema
at graphql.Assert.assertNotNull(Assert.java:17)
at graphql.schema.GraphQLTypeResolvingVisitor.handleTypeReference(GraphQLTypeResolvingVisitor.java:49)
at graphql.schema.GraphQLTypeResolvingVisitor.visitGraphQLTypeReference(GraphQLTypeResolvingVisitor.java:44)
at graphql.schema.GraphQLTypeReference.accept(GraphQLTypeReference.java:62)
at graphql.schema.SchemaTraverser$TraverserDelegateVisitor.enter(SchemaTraverser.java:109)
at graphql.util.Traverser.traverse(Traverser.java:144)
at graphql.schema.SchemaTraverser.doTraverse(SchemaTraverser.java:96)
at graphql.schema.SchemaTraverser.depthFirst(SchemaTraverser.java:86)