title: How do I create a mutation that pushes to an array rather than replacing it?
body: <p>I've been playing with GraphQL recently, and am currently learning about mutations. I'm a bit confused with something. I have a model <code>Post</code> with relation <code>Comments</code>. I have a mutation that looks like this:</p>
  
  <pre class="lang-graph-ql prettyprint-override"><code>mutation addCommentToPost {
    updatePost(
      id: "POST-1",
      comments: [{
        body: "Hello!"
      }]
    ) {
      id,
      comments {
        id,
        body
      }
    }
  }
  </code></pre>
  
  <p>The problem is, whenever I run this, it seems to remove all the comments and sets the comments to only the one I just added. To be more specific, how do I write a mutation that <em>pushes</em> to the <code>comments</code> array rather than replacing it?</p>