Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedesilva/2d206ff0b559bb9b433aa9da015c9332 to your computer and use it in GitHub Desktop.
Save fedesilva/2d206ff0b559bb9b433aa9da015c9332 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