title: How to run graphql queries from a json file
body: <p>I have just started learning about the GraphQl api's in android.The problem which iam facing right now is that, i have no idea about how this api's are working.I have refrences from below link-:</p>
  
  <p><a href="https://www.contentstack.com/docs/guide/contentstack-graphql-api/using-graphql-with-apollo-client-android-sdk" rel="nofollow noreferrer">https://www.contentstack.com/docs/guide/contentstack-graphql-api/using-graphql-with-apollo-client-android-sdk</a></p>
  
  <p>Where it's asking to download schema file of your api.</p>
  
  <p>Is there any way by how i can run my schema.json file in any type of console by which i can understand how this will work to get the correct data.</p>
  
  <p>Thanks</p>
  
  <p>Here is the code below which iam using--</p>
  
  <pre><code>
  
      val BASE_URL="https://api.github.com/graphql"
  
       fun getClient(): ApolloClient {
          val okHttp = OkHttpClient
              .Builder()
              .addInterceptor({ chain -&gt;
                  val original = chain.request()
                  val builder = original.newBuilder().method(original.method(),
                      original.body())
                  builder.addHeader("Authorization"
                      , "Bearer " + "bac8dc6fd2119fcdbe94332c3e1aa2c43f897b24")
                  chain.proceed(builder.build())
              })
              .build()
          return ApolloClient.builder()
              .serverUrl(BASE_URL)
              .okHttpClient(okHttp)
              .build()
      }
  
  }
  </code></pre>
  
  <p>and for calling service...</p>
  
  <pre><code>            progress_bar.visibility = View.VISIBLE
              client.getClient().query(FindQuery
                  .builder()
                  .name(repo_name_edittext.text.toString())
                  .owner(owner_name_edittext.text.toString())
                  .build())
                  .enqueue(object : ApolloCall.Callback&lt;FindQuery.Data&gt;() {
  
                      override fun onFailure(e: ApolloException) {
                          Log.d("exception ",e.message.toString())
  
                          progress_bar.visibility = View.GONE
                      }
  
                      override fun onResponse(response: Response&lt;FindQuery.Data&gt;) {
                          Log.d(" " + response.data()?.repository(),"")
                          runOnUiThread {
                              progress_bar.visibility = View.GONE
                              name_text_view.text = String.format(getString(R.string.name_text),
                                  response.data()?.repository()?.name())
                              description_text_view.text = String.format(getString(R.string.description_text),
                                  response.data()?.repository()?.description())
                              forks_text_view.text = String.format(getString(R.string.fork_count_text),
                                  response.data()?.repository()?.forkCount().toString())
                              url_text_view.text = String.format(getString(R.string.url_count_text),
                                  response.data()?.repository()?.url().toString())
                          }
                      }
  
                  })
          }
  
  
      }
  </code></pre>
  
  <p>Graphql file used-:</p>
  
  <pre><code>
    user(login: $login) {
        repositories(first:20){
          nodes{
            id
            name
          }
        }
      }
  }
  </code></pre>
  
  <p>Gradle Files</p>
  
  <pre><code>implementation 'com.apollographql.apollo:apollo-runtime:1.2.0'
      implementation "com.apollographql.apollo:apollo-android-support:1.2.0"
  </code></pre>