title: setting up typescript with webpack
body: <p>I am using Typescript to develop a back-end API with graphql and express. I am using webpack to manage the project development and building process.</p>
  
  <p>I am using raw-loader to load graphql schemas and sql queries from files as strings.</p>
  
  <p>Currently I am facing some issues that I don't really understand.</p>
  
  <p>webpack.config.js</p>
  
  <pre><code>const path = require('path');
  
  module.exports = {
    target: 'node',
    entry: {
      server: path.resolve(__dirname, 'server.ts'),
    },
    output: {
      filename: 'server.js',
      path: path.resolve(__dirname, 'dist'),
    },
    devtool: 'source-map',
    module: {
      rules: [
        {
          test: /\.(gql|sql)$/,
          loader: 'raw-loader',
        },
        {
          test: /\.ts$/,
          loader: 'ts-loader',
        },
      ],
    },
    resolve: {
      extensions: ['.ts', '.js'],
    },
    watch: {
      ignored: /node_modues/,
    },
  };
  </code></pre>
  
  <p>server.ts</p>
  
  <pre><code>import express from 'express';
  import morgan from 'morgan';
  import bodyParser from 'body-parser';
  import graphqlHTTP from 'express-graphql';
  
  import { affairSchema } from './src/schemas';
  import affairRoot from './src/resolvers/affairs';
  
  const app = express();
  
  app.use(morgan('combined'));
  app.use(bodyParser.json());
  
  app.use(
    '/graphql',
    graphqlHTTP({
      schema: affairSchema,
      rootValue: affairRoot,
      graphiql: true,
    })
  );
  
  const port = process.env.PORT || 4000;
  app.listen(port, () =&gt; console.log('Server waiting on ', port));
  </code></pre>
  
  <p>errors:</p>
  
  <pre><code>ERROR in ./node_modules/graphql/index.mjs
  88:0-148:42 Can't reexport the named export 'typeFromAST' from non EcmaScript module (only default export is available)
   @ ./node_modules/graphql/index.mjs
   @ ./src/schemas/index.ts
   @ ./server.ts
  
  ERROR in ./node_modules/graphql/index.mjs
  88:0-148:42 Can't reexport the named export 'valueFromAST' from non EcmaScript module (only default export is available)
   @ ./node_modules/graphql/index.mjs
   @ ./src/schemas/index.ts
   @ ./server.ts
  
  ERROR in ./node_modules/graphql/index.mjs
  88:0-148:42 Can't reexport the named export 'valueFromASTUntyped' from non EcmaScript module (only default export is available)
   @ ./node_modules/graphql/index.mjs
   @ ./src/schemas/index.ts
   @ ./server.ts
  
  ERROR in C:\Users\houssem\Projects\ctc\services\affairs\src\schemas\index.ts
  ./src/schemas/index.ts
  [tsl] ERROR in C:\Users\houssem\Projects\ctc\services\affairs\src\schemas\index.ts(5,28)
        TS2307: Cannot find module './affairs.gql'.
  
  ERROR in C:\Users\houssem\Projects\ctc\services\affairs\services\database\engineer.ts
  ./services/database/engineer.ts
  [tsl] ERROR in C:\Users\houssem\Projects\ctc\services\affairs\services\database\engineer.ts(7,19)
        TS2307: Cannot find module './engineer.sql'.
  .
  .
  .
  .
  .
  </code></pre>