const express = require('express');
const bodyParser = require('body-parser');
const { graphqlExpress, graphiqlExpress } = require('graphql-server-express');
const { makeExecutableSchema } = require('graphql-tools');
const fs = require('fs');
const glob = require('glob');

const fileNames = glob.sync('./schema/*.graphql')
if (fileNames.length === 0) {
    throw GraphQLLoaderError.zeroMatchError(pattern)
}

const typeDefs = fileNames.map(fileName => fs.readFileSync(fileName, 'utf8'));

class PersonResolver {
    name(args, context) {
        return 'super';
    }
    age() {
        return 123;
    }
    dog() {
        return new DogResolver();
    }
}

class DogResolver {
    name() {
        return 'rufus';
    }
}

const resolvers = {
    Query: {
        hello(obj, args, context, info) {
            return 'world';
        },
        human() {
            return new PersonResolver();
        }
    }
};

const schema = makeExecutableSchema({ typeDefs, resolvers });
const app = express();
app.use((req, res, next) => {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Methods", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    if (req.method === 'OPTIONS') {
        return res.send(200);
    } else {
        return next();
    }
});
app.use('/graphql', bodyParser.json(), graphqlExpress({ schema }));
app.use('/graphiql', graphiqlExpress({ endpointURL: '/graphql' }));
app.listen(4000, () => console.log('Now browse to localhost:4000/graphiql'));
@@ -1,12 +1,13 @@
-cons
+impor
 t expres
@@ -8,26 +8,21 @@
 express 
-= require(
+from 
 'express
@@ -22,23 +22,23 @@
 express'
-)
 ;%0A
-cons
+impor
 t bodyPa
@@ -42,26 +42,21 @@
 yParser 
-= require(
+from 
 'body-pa
@@ -60,23 +60,23 @@
 -parser'
-)
 ;%0A
-cons
+impor
 t %7B grap
@@ -105,26 +105,21 @@
 press %7D 
-= require(
+from 
 'graphql
@@ -134,23 +134,23 @@
 express'
-)
 ;%0A
-cons
+impor
 t %7B make
@@ -168,26 +168,21 @@
 chema %7D 
-= require(
+from 
 'graphql
@@ -192,65 +192,54 @@
 ols'
-)
 ;%0A
-const fs = require(
+import fs from 
 'fs'
-)
 ;%0A
-cons
+impor
 t glob 
-= require(
+from 
 'glob'
-)
 ;%0A%0Ac

Change to es6 imports