# frozen_string_literal: true

module Mutations
  module <%= moduleName %>
    # User sign-up mutation
    class <%= className %> < Mutations::BaseMutation
      # Define the input arguments for the mutation
<% fields.forEach(function(field) { -%>
      argument :<%= field.name %>, <%= field.type %>, required: true
<% }); -%>

      return_type Types::UserType

      def resolve(<%= fields.map(function(field) { return field.name + ':' }).join(', ') %>) # rubocop:disable Metrics/ParameterLists
        super
        AuthService.new.sign_up(<%= fields.map(function(field) { return field.name }).join(', ') %>)
      end
    end
  end
end 