Invalid Graphql schema after Quarkus update #35031
Replies: 2 comments
-
Do you have an executable reproducer for this? Or, at least, source code of the model classes that trigger this problem? Also, what exact version are you updating from, and what version to? |
Beta Was this translation helpful? Give feedback.
-
My issue happens in combination with the org.eclipse.microprofile.graphql package. I have a Java bean for the ProductInventoryByStorageUnits class which extends a super class. I am using some Annotation Types from that package as decorators for the variables of the superclass. Those variables are inherited by the subclass but the variable decorators are somehow ignored and that causes the issue. I rewrote ProductInventoryByStorageUnits and removed the inheritance from the superclass. That fixed the issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an issue with a GraphQL schema which can no longer be injected after the Quarkus version has been updated to the latest one. I get following stack trace:
Caused by: java.lang.RuntimeException: Failed to start quarkus at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source) ... 30 more Caused by: graphql.schema.validation.InvalidSchemaException: invalid schema: object type 'ProductInventoryByStorageUnit' does not implement interface 'ProductInventory' because field 'id' is defined as 'Id' type and not as 'ID!' type object type 'ProductInventoryByStorageUnit' does not implement interface 'ProductInventory' because field 'quantity' is defined as 'Quantity' type and not as 'Quantity!' type object type 'ProductInventoryByStorageUnit' does not implement interface 'Entity' because field 'id' is defined as 'Id' type and not as 'ID!' type "Id" must define one or more fields. at graphql.schema.GraphQLSchema$Builder.validateSchema(GraphQLSchema.java:945) at graphql.schema.GraphQLSchema$Builder.buildImpl(GraphQLSchema.java:939) at graphql.schema.GraphQLSchema$Builder.build(GraphQLSchema.java:904) at io.smallrye.graphql.bootstrap.Bootstrap.generateGraphQLSchema(Bootstrap.java:200) at io.smallrye.graphql.bootstrap.Bootstrap.bootstrap(Bootstrap.java:119) at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:52) at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:42) at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:32) at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:27) at io.smallrye.graphql.cdi.producer.GraphQLProducer_ClientProxy.initialize(Unknown Source) at io.quarkus.smallrye.graphql.runtime.SmallRyeGraphQLRecorder.createExecutionService(SmallRyeGraphQLRecorder.java:30) at io.quarkus.deployment.steps.SmallRyeGraphQLProcessor$buildExecutionService1691419614.deploy_6(Unknown Source) at io.quarkus.deployment.steps.SmallRyeGraphQLProcessor$buildExecutionService1691419614.deploy(Unknown Source) ... 31 more
At the first moment, it looks like an easy fix because I just need to modify the schema.graphql file, but it looks already fine and does not reflect the error messages I got:
type ProductInventoryByStorageUnit implements Entity & ProductInventory { id: ID itemInventories: [ItemInventory!]! product: Product! quantity: Quantity! storageUnit: StorageUnit! } interface Entity { id: ID! } interface ProductInventory { id: ID! itemInventories: [ItemInventory!]! quantity: Quantity! }
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions