forked from pgutkowski/KGraphQL
-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
Hey,
I've tried to implement KGraphQL with Ktor version 2.0.2, but for the life of me, couldn't get it to work, I would always get JSON parse error unexpected end of file. Inspecting this, in the end I found that the issue is with
receiveStream() call in receiveTextWithCorrectEncoding() method. I would get Acquiring blocking primitives on this dispatcher is not allowed. Consider using async channel or doing withContext(Dispatchers.IO) { call.receive<InputStream>().use { ... } } instead.
So, when I tried the suggested, it worked.
I couldn't make a PR so, here's a suggestion
return withContext(Dispatchers.IO) { receiveStream().bufferedReader(charset = suitableCharset).readText() }
Metadata
Metadata
Assignees
Labels
No labels