Skip to content

Instantly share code, notes, and snippets.

@pie6k
Last active April 20, 2018 10:38
Show Gist options
  • Save pie6k/352a48c6029dded917115d14d902a1b7 to your computer and use it in GitHub Desktop.
Save pie6k/352a48c6029dded917115d14d902a1b7 to your computer and use it in GitHub Desktop.
import * as express from 'express';
import * as graphqlHTTP from 'express-graphql';
import { compileSchema } from 'typegql';
import { FirstSchema } from './simpleSchema.ts'
const schema = compileSchema(FirstSchema);
const app = express();
app.use(
'/graphql',
graphqlHTTP({
schema,
graphiql: true,
}),
);
app.listen(3000, () => {
console.log('Api ready on port 3000');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment