title: Execute raw graphQL query using OkHttp Client
body: <p>I have a graphQL query that I want to execute it as raw request and don't want to depend on any clients to execute this request (I don't want to use apollo client for android to execute it)</p>
  
  <p>I have created the string that forms this query and tries to make this request using OkHttp client but I think there is something missing because of every time I send the request the respond is internal server error. But if I execute this query using apollo-client for android it returns with a response. </p>
  
  <p>Here is my try for executing the raw query request using OkHttp: </p>
  
  <pre><code>val requestBodyString = "  cities{\n" +
              "    name\n" +
              "  }"
  
  fun makeRequest(url: String): Response{
          val client = OkHttpClient()
          val requestBody = RequestBody.create(null, requestBodyString)
          val request = Request.Builder().url(url).post(requestBody)
              .addHeader("content-type", "application/graphql").build()
          return client.newCall(request).execute()
      }
  </code></pre>
  
  <p>I follow <a href="https://www.yelp.com/developers/graphql/guides/requests" rel="nofollow noreferrer">yelp documentation</a> for making requests but it doesn't work for me. and I can't figure why? </p>