Skip to content

Instantly share code, notes, and snippets.

@OlegIlyenko
Last active October 25, 2019 03:59
Show Gist options
  • Save OlegIlyenko/4068ad92e008cd4b5def1baa4ec3a67c to your computer and use it in GitHub Desktop.
Save OlegIlyenko/4068ad92e008cd4b5def1baa4ec3a67c to your computer and use it in GitHub Desktop.
An example of minimal self-contained snippet that reproduces specific issue
// Imports that you are using
import sangria.schema._
import sangria.execution._
import sangria.macros._
import sangria.marshalling.circe._
import scala.concurrent.ExecutionContext.Implicits.global
// The schema definition
val QueryType = ObjectType("Query", fields[Unit, Unit](
Field("hello", StringType, resolve = _ ⇒ "Hello world!")
))
val schema = Schema(QueryType)
// Test query
val query = graphql"{ hello }"
val result = Executor.execute(schema, query)
result.foreach(res ⇒ println(res.spaces2))
// Expected output:
//
// {
// "hello": "Hello world!"
// }
// Actual output:
//
// ???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment