title: Graphql Query testing doesn't return correctly the result in Phoenix
body: <p>Hello everyone I'm just new to Elixir, generally new to FP. So basically I try to learn Elixir and afterwards jump to building a graphql api server. </p>
  
  <p>I read and follow the book "Craft GraphQL APIs in Elixir with Absinthe" and stuck at  the testing of a graphql query.</p>
  
  <p>Here's what the book said:</p>
  
  <pre><code>test "menuItems field returns menu items" do
    conn = build_conn()
    conn = get conn, "/api", query: @query
    assert json_response(conn, 200) == %{
     "data" =&gt; %{
       "menuItems" =&gt; [
         //key-value pair
       ]
     }
    }
  end
  </code></pre>
  
  <p>Here's what the I attempt , I noticed that in my local machine when I make a query it uses POST method rather than GET method so I change it to post instead:</p>
  
  <pre><code>@query """
  {
    courses {
      name
    }
  }
  """
  
  test "courses field returns courses" do
    conn = build_conn()
    conn = post conn, "/api/graphiql", query: @query
    assert json_response(conn, 200) === %{
      "data" =&gt; %{
        "courses" =&gt; [
          %{"name" =&gt; "BSIT"},
          %{"name" =&gt; "BSCS"},
          %{"name" =&gt; "BSBA"}
        ]
      }
    }
  end
  </code></pre>
  
  <p>Then when I run the test it fails because the query returns empty result.</p>
  
  <pre><code>Assertion with === failed
    code:  assert json_response(conn, 200) === %{"data" =&gt; %{"courses" =&gt; [%{"name" =&gt; "BSIT"}, %{"name" =&gt; "BSCS"}, %{"name" =&gt; "BSBA"}]}}
    left:  %{"data" =&gt; %{"courses" =&gt; []}}
    right: %{"data" =&gt; %{"courses" =&gt; [%{"name" =&gt; "BSIT"}, %{"name" =&gt; "BSCS"}, %{"name" =&gt; "BSBA"}]}}
    stacktrace:
      test/voting_system_web/query/course_test.exs:15: (test)
  </code></pre>
  
  <p>Then I try testing the  query through curl and the query works and returns a result.</p>
  
  <pre><code> curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ courses { name } }"}' http://localhost:4000/api/graphiql
   {"data":{"courses":[{"name":"BSIT"},{"name":"BSCS"},{"name":"BSBA"}]}}% 
  </code></pre>