title: laravel lighthouse : how to auto calculate field base on its max value
body: <p>i've this in my laravel app to save articles:</p>
  <pre><code>public function store()
      {
          $request =request();
          $res['result'] = Article::create([
              'ref' =&gt; Article::whereYear($request-&gt;year)-&gt;max('ref') + 1,//calculated based on last (highest value for this year) + 1. every year its reinitialized to 0
              'year' =&gt; $request-&gt;year,
              'stat' =&gt; $request-&gt;stat,
              'date_avis_red' =&gt; $request-&gt;date_avis_red,
          ]);
          
          return $res;
      }
  </code></pre>
  <p>is there a way to do the same thing with graphql whene execution the mutation of saving articles?
  here is the mutation type:</p>
  <pre><code>saveArt(
      id: ID
      year: Int!,
      ref:  Int, // i want this to be calculated based on the max ref for this year + 1 (sequential)
      stat: String,
      date_avis_red: Date,
  ): Article! @upsert
  </code></pre>
  <p>can someone give me the idea? thanks for all!</p>