How do I structure authenticated queries with GraphQL? : <p>I was thinking of writing an API that does the following things:</p>

<ul>
<li>Sign-up and sign-in users which provide the user with an authentication token</li>
<li>Create maps (data example: <code>{ name: “Quotes”, attributes: [“quote”, “author"] }</code>)</li>
<li>Create map items (data example: <code>{ quote: "...", author: "..." }</code>)</li>
</ul>

<p>I would build the queries somewhat like this:</p>

<pre><code>// return the name and id of all the user's maps
maps(authToken="…") {
  name,
  id
}

// return all the items of a single map
maps(authToken="…") {
  map(name=“Quotes") {
    items
  }
}

// OR by using the map_id
maps(authToken="…") {
  map(id=“…") {
    items
  }
}
</code></pre>

<p><strong>So, my question is, is this correct or would I need to structure it differently?</strong></p>
