Does graphlq-kotlin work with spring 2.7.0? I’m us...
# graphql-kotlin
r
Does graphlq-kotlin work with spring 2.7.0? I’m using 5.4.1 https://github.com/rowi1de/graphql-reactive/runs/6516519218?check_suite_focus=true#step:5:66
Copy code
Caused by: java.lang.ClassCastException at SchemaPrinter.java:762
d
@Saurav Tapader just opened up a PR to bump the dependencies (including spring boot 2.7)
❤️ 1
s
needs some approval
d
that being said -> schema printer is from
graphql-java
so it kind of looks like you got classpath problem with
graphql-java
and not spring
🤔 1
r
I only include implementation("com.expediagroupgraphql kotlin spring server5.4.1")
d
hmm unsure then, it certainly does look like some classpath issue ->
graphql-kotlin 5.4.1
depends on
graphql-java 17.2
but it only increments count in the schema printer (https://github.com/graphql-java/graphql-java/blob/v17.2/src/main/java/graphql/schema/idl/SchemaPrinter.java#L762) In the latest
graphql-java
(18.1) it attempts to get list of predicates -> https://github.com/graphql-java/graphql-java/blob/v18.1/src/main/java/graphql/schema/idl/SchemaPrinter.java#L762 which used to be
Predicate<GraphQLDirective>
(in old version) and are now just
Predicate<String>
we have pre-release versions out that bump the
graphql-java
dependency to
18.1
so you could try that
latest ->
6.0.0-alpha.4
r
Thanks for the hint, worth a try. It's just a demo project with automated dependabot PRs, which just bumped spring from 2.6.7 to 2.7.0. Spring now has an own grapql starter based on graphql-java .. maybe this is messing up something?
d
indeed good callout
yeah thats probably it
r
I don't include that starter but could think something in spring boot itself could do some autoconfiguration because some graphql-java is on the classpath… just guessing, would need to check later
d
try debugging your classpath to see where it comes from
r
Copy code
id("io.spring.dependency-management") version "1.0.11.RELEASE"
here it comes from
Copy code
com.expediagroup:graphql-kotlin-spring-server:6.0.0-alpha.4
works again
d
I dont think you need the spring dep management plugin (wasnt this an old deprecated way? I think you can import boms using
platform
dep)
r
https://start.spring.io/#!type=gradle-project&amp;language=kotlin&amp;platformVersion=2.7.0&amp;packaging=jar&amp;jvmVersion=17&amp;groupId=com.example&amp;artifactId=demo&amp;name=demo&amp;description=Demo%20project%20for%20Spring%20Boot&amp;packageName=com.example.demo<https://start.spring.io/#!type=gradle-project&language=kotlin&platformVersion=2.7.0&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo|
I think it's up to date
d
Yeah they still publish it but I think using bom natively (through platform) is generally preferred option
r
That would make it easier, good to know 👍🏻