Notable differences between buildSchema and GraphQLSchema? : <p>Are there any notable differences between the two? Im interested in anything from runtime and startup performance to features and workflow differences. Documentation does a poor job on explaining the difference and when I should use one over the other.</p>

<h1>Example in both versions:</h1>

<h3>buildSchema</h3>

<pre class="lang-js prettyprint-override"><code>const { graphql, buildSchema } = require('graphql');

const schema = buildSchema(`
  type Query {
    hello: String
  }
`);

const root = { hello: () =&gt; 'Hello world!' };

graphql(schema, '{ hello }', root).then((response) =&gt; {
  console.log(response);
});
</code></pre>

<h3>GraphQLSchema</h3>

<pre class="lang-js prettyprint-override"><code>const { graphql, GraphQLSchema, GraphQLObjectType, GraphQLString } = require('graphql');

const schema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: 'Query',
    fields: () =&gt; ({
      hello: {
        type: GraphQLString,
        resolve: () =&gt; 'Hello world!'
      }
    })
  })
});

graphql(schema, '{ hello }').then((response) =&gt; {
  console.log(response);
});
</code></pre>
