title: Apollo GraphQL: Call a Mutation from the Server?
body: <p>I need to call a mutation from a cron job running on the server. <a href="https://stackoverflow.com/questions/44172332/apollo-call-a-mutation-server-side-from-cron-job">I found this SO post</a>, but the accepted answer said there was no way to do it.</p>
  <p><a href="https://github.com/apollographql/apollo-server/issues/289" rel="nofollow noreferrer">Then I found this on GitHub, from 2017</a>:</p>
  <blockquote>
  <p><code>graphql-server</code> is a network wrapper for <code>graphql core</code> function. if you
  don't want to use it over network, you can just run it standalone:</p>
  <pre><code>import scheme from './scheme';
  
  const query = `{
    me {
      name   
    }
  }`;
  
  const result = graphql(scheme, query);
  console.log(result); 
  </code></pre>
  <p>function documentation can be found <a href="https://github.com/graphql/graphql-js/blob/master/src/graphql.js#L19" rel="nofollow noreferrer">here</a></p>
  </blockquote>
  <p>That looks pretty good! Is that the best practices approach in 2020?</p>