Skip to content

Instantly share code, notes, and snippets.

@ermadmi78
Created October 20, 2021 13:16
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 ermadmi78/f576572334b956d69b5b8d2643dc9b2a to your computer and use it in GitHub Desktop.
Save ermadmi78/f576572334b956d69b5b8d2643dc9b2a to your computer and use it in GitHub Desktop.
// Instantiate DSL context
val context = cinemaContextOf(createKtorAdapter())
val result = context.query {
film(id = 0L) {
id()
title()
actors {
id()
firstName()
lastName()
}
}
}
result.film?.also { film ->
println(film.title)
film.actors.forEach { actor ->
println(" ${actor.firstName} ${actor.lastName}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment