Are there any examples of using Sangria with a Scala 3 program, or is that a non-starter? Using cross-compilation in SBT builds OK, but getting a NoSuchMethodError exception in Executor.execute when I send a query.
build.sbt looks like this:
val AkkaVersion = "2.6.21"
val SangriaAkkaHttpVersion = "0.0.4"
crossScalaVersions := Seq("2.13.5", "3.3.0")
ThisBuild / scalaVersion := "3.3.0"
("com.typesafe.akka" %% "akka-actor-typed" % AkkaVersion).cross(CrossVersion.for3Use2_13),
("com.typesafe.akka" %% "akka-stream-typed" % AkkaVersion).cross(CrossVersion.for3Use2_13),
("org.sangria-graphql" %% "sangria-akka-http-circe" % SangriaAkkaHttpVersion).cross(CrossVersion.for3Use2_13),
Any clues as to how to get this to work?
Error message:
java.lang.NoSuchMethodError: 'scala.runtime.BoxedUnit sangria.execution.Executor$.execute$default$4()'
at XXX.graphql.GraphQlServer$$anon$1.applyOrElse(GraphQlServer.scala:55)
at XXX.graphql.GraphQlServer$$anon$1.applyOrElse(GraphQlServer.scala:49)
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:35)
at sangria.http.akka.SangriaAkkaHttp.$anonfun$prepareGraphQLPost$2(SangriaAkkaHttp.scala:137)
It turns out that the quickest solution was to switch from
akkatopekko(painless) and modify theakka-httphelpers forsangriato usepekko-http.Specifically, I cloned
sangria-akka-http-core,sangria-akka-http-circe, andakka-http-circe, and replacedimport akkawithimport org.apache.pekko. Other than that the main issues were with the build process rather than the code.Hopefully there will be official
pekkoversions of these libraries at some point.