title: How to update kwargs the Ruby / Rails way?
body: <p>I have this in a GraphQL resolver:</p>
  <pre><code>def resolve(id:, tag_ids: nil, **kwargs)
    article = current_user.articles.find(id)
    tags = tag_ids ? Tag.where(id: tag_ids) : article.tags
    article.update!(tags: tags, **kwargs)
    article
  end
  </code></pre>
  <p>I basically want to only pass in the <code>tags</code> key/value pair to <code>article.update!</code> if tags is NOT <code>nil</code>. I am doing an ugly hack by setting it back to <code>article.tags</code>.</p>
  <p>How do I do this the proper way, can I do something like this?</p>
  <pre><code>def resolve(id:, tag_ids: nil, **kwargs)
    article = current_user.articles.find(id)
    tags = tag_ids ? Tag.where(id: tag_ids) : nil
    if tags then kwargs.append!(tags: tags)
    article.update!(**kwargs)
    article
  end
  </code></pre>
  <p>If there's no standard way of doing this, what is a better way to accomplish this so it's less messy and works?</p>