How to use GraphQL with Retrofit on Android? : <p>I'm new to GraphQL but I have been using Retrofit for a while now and its easy to use and fast. GraphQL is much different than rest apis in terms of how you pass data. There really are not too many tutorials out there on using GraphQL with Android, I was only able to find this video (<a href="https://www.youtube.com/watch?v=P0uJHI7GjIc&amp;t=1s" rel="noreferrer">https://www.youtube.com/watch?v=P0uJHI7GjIc&amp;t=1s</a>) but there is no real code in there. </p>

<p>In my current code for retrofit calls I have an endpoint I set like so:</p>

<pre><code>final RestAdapter restAdapter = new RestAdapter.Builder()
                .setEndpoint(endPoint)
                .build();
        T service = restAdapter.create(clazz);
</code></pre>

<p>Then I call a rest service like this:</p>

<pre><code>@GET("/users/{login}")
    Observable&lt;Github&gt; getUser(@Path("login") String login);
</code></pre>

<p>Now with GraphQL you only have a base url and no service path. Also if you are querying like userId=1 then you have to send as Post with Body parameters: </p>

<pre><code>operationName: arbitrary name ,
query: "{users(userid:$userId){username}}, 
variables: "{"userId":1}"
</code></pre>

<p>I'm just not sure how this translates to Retrofit</p>
