You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: add_articles_to_collection.rb
    path of file: ./repos/chaskiq/app/graphql/mutations/articles
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Mutations
  module Articles
    class AddArticlesToCollection < Mutations::BaseMutation
      field :collection, Types::CollectionType, null: false
      argument :app_key, String, required: true
      argument :collection_id, String, required: true
      argument :articles_id, [String], required: true

      def resolve(app_key:, collection_id:, article
    
      def resolve(app_key:, collection_id:, articles_id:)
        app = App.find_by(key: app_key)

        authorize! app, to: :can_manage_help_center?, with: AppPolicy, context: {
          app: app
        }
        collection = app.article_collections.find(collection_id)

        app.articles.where(id: articles_id).find_each do |a|
          a.update(collection: collection, section: nil)
        end

        { collection: collection }
      end