Created
December 14, 2021 12:34
-
-
Save ermadmi78/af3826d04dd0c1b563f8fa012daf2b70 to your computer and use it in GitHub Desktop.
Subscription preview
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
// Kotlin | |
launch(Dispatchers.Default) { | |
context.subscription { | |
filmCreated { | |
id() | |
title() | |
} | |
}.subscribe { | |
while (true) { | |
val result = receive() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment