This might help you Got the program working by changing the above code as below. And it is a good practice to use a JSON library to create complex JSON like above other than manually creating it as most of the time, manual creation of a complex JSON may lead to lot of troubles.
I think the issue was by ths following , Above stack trace comes when you try to use electron based GraphiQL.app which was not updated since Mar 22, 2018 (v.0.7.2). So, to fix an issue and see subscription working:
<!-- Graph(i)QL tool: for development -->
val client = HttpClients.createDefault()
val httpPost = HttpPost(url)
val postParameters = ArrayList<NameValuePair>()
postParameters.add(BasicNameValuePair("query", "query as string"))
postParameters.add(BasicNameValuePair("variables", "variables json string"))
httpPost.entity = UrlEncodedFormEntity(postParameters, Charset.defaultCharset())
val response = client.execute(httpPost)
val ret = EntityUtils.toString(response.getEntity())
Why am I able to bypass pagination when I call the same field twice (with different queries) in GitHub's GraphQL API
I wish did fix the issue. TLDR; This appears to be a bug. There's no way to bypass the limit applied when fetching a list of resources. Limiting responses like this is a common feature of public APIs -- if the response could include thousands or millions of results, it'll tie up a lot of server resources to fulfill it all at once. Allowing users to make those sort of queries is both costly and a potential security risk.