title: GraphQL to CURL example
body: <p>I'm attempting to test an API from FreeAgent CRM that implements GraphQL.</p>
  <p>I'm struggling to format the request for the following example. <a href="https://api.freeagent.network/#list-app-fields" rel="nofollow noreferrer">https://api.freeagent.network/#list-app-fields</a></p>
  <p>This is the example of the request:</p>
  <pre><code>query getFields($entity:String,$show_hidden:Boolean) {
    getFields(entity:$entity,show_hidden:$show_hidden){
      id
      name
      name_label
      main_type
      is_required
      is_visible
      is_unique
      default_value
      catalog_type_id
      reference_field_id
      reference_fa_entity_id
      reference_fa_entity_name
    }
  }
  </code></pre>
  <p>I've converted this to json in order to send it with a cURL request from the command line.</p>
  <p><code>curl -i -H &quot;Authorization: bearer MY_TOKEN&quot; -X POST -d '{&quot;query&quot;: &quot;query getFields($entity:&quot;products&quot;,$show_hidden:false) { getFields(entity:$entity,show_hidden:$show_hidden){ id name name_label main_type is_required is_visible is_unique default_value catalog_type_id reference_field_id reference_fa_entity_id reference_fa_entity_name }}&quot;}' https://freeagent.network/api/graphql</code></p>
  <p>I've attempted to format this various ways, I'm not sure if I'm interpreting the graphql documentation wrong, or if there is something funny happening in this specific API and how it is setup.</p>
  <p>Regardless of the format that I try to send, I get an error that no query string is supplied.</p>
  <pre><code>{&quot;errors&quot;:[{&quot;message&quot;:&quot;Must provide query string.&quot;}]}
  </code></pre>
  <p>I've reached out to the support team, but wanted to cast a broader net so that I can learn more about graphql as I'm sure I'll get a better explanation as to what I'm doing wrong from the SO community.</p>