smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

Add more info to the "Ignoring non null" message

Open jmartisk opened this issue 1 year ago • 7 comments

    2024-09-04T22:16:39.6005201Z 2024-09-04 22:16:39,512 WARN [io.sma.gra.sch.hel.NonNullHelper] (build-11) Ignoring non null on [java.lang.String] as there is a @DefaultValue

To make the message a bit more useful, we should attach some info saying which argument this is related to, This message is logged by io.smallrye.graphql.schema.helper.NonNullHelper

jmartisk avatar Sep 06 '24 07:09 jmartisk

….and it should not be a warning, should it?

t1 avatar Sep 06 '24 08:09 t1

Hmm you're not the first person pointing this out, but I disagree, because it means that the framework has decided to override something that the user wrote (the user added NonNull but we still make it nullable in the end)

jmartisk avatar Sep 06 '24 09:09 jmartisk

Hmmm... you're right. Then we should make it an error and fail the deployment, if a @NonNull is combined with a @DefaultValue, shouldn't we?

t1 avatar Sep 06 '24 10:09 t1

That makes sense. @gsmet would you agree, since you're the first person who brought this up?

jmartisk avatar Sep 06 '24 10:09 jmartisk

FWIW, if you make it an error, I think the Quarkus CI will fail, given I found out about this message in the Quarkus CI. Well, except we have a bug that won't trigger the codestarts test as the dependencies are not properly declared.

But that might be a good way to find out who the culprit is.

Ideally, do the change, deploy a snapshot of SmallRye GraphQL, update the Quarkus BOM, build the entire Quarkus tree and try running mvn -f integration-tests/devtools clean verify.

This is where I got this thing: one of the codestarts test somehow triggers it but I wasn't able to reproduce it by isolating a specific test.

You have an example of the warning here: https://github.com/quarkusio/quarkus/actions/runs/10710128172/job/29696739970 . Look for NonNull in the logs.

gsmet avatar Sep 06 '24 13:09 gsmet

Ah crap, it seems a class from the TCK uses this: https://github.com/eclipse/microprofile-graphql/blob/main/server/tck/src/main/java/org/eclipse/microprofile/graphql/tck/apps/superhero/model/Item.java#L156 so it breaks the TCKs completely, because the schema won't build at all.. And I don't think we can easily work around this.

jmartisk avatar Sep 10 '24 08:09 jmartisk

Crap. Maybe we can sneak a bugfix release in? @phillip-kruger ?

t1 avatar Sep 10 '24 09:09 t1