This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
kotlin("jvm") | |
id("io.github.ermadmi78.kobby") version "1.4.0" | |
} | |
dependencies { | |
// Add this dependency to enable Jackson annotation generation in DTO classes | |
compileOnly("com.fasterxml.jackson.core:jackson-annotations:2.12.2") | |
// Add this dependency to enable default Ktor adapters generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GraphQL | |
subscription { | |
filmCreated { | |
id | |
title | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GraphQL | |
query { | |
film(id: 0) { | |
id | |
title | |
actors { | |
id | |
firstName | |
lastName | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GraphQL | |
mutation { | |
createFilm(title: "My Film") { | |
id | |
title | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate DSL context | |
val context = cinemaContextOf(createKtorAdapter()) | |
launch(Dispatchers.Default) { | |
context.subscription { | |
filmCreated { | |
id() | |
title() | |
} | |
}.subscribe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"filmCreated": { | |
"id": "4", | |
"title": "My Film" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subscription { | |
filmCreated { | |
id | |
title | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate DSL context | |
val context = cinemaContextOf(createKtorAdapter()) | |
val result = context.mutation { | |
createFilm(title = "My Film") { | |
id() | |
title() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"createFilm": { | |
"id": "4", | |
"title": "My Film" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation { | |
createFilm(title: "My Film") { | |
id | |
title | |
} | |
} |
NewerOlder