mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
20 lines
377 B
TypeScript
20 lines
377 B
TypeScript
import * as Koa from 'koa';
|
|
import * as mount from 'koa-mount';
|
|
import graphqlHTTP from 'koa-graphql';
|
|
import { buildSchema } from 'graphql';
|
|
|
|
const schema = buildSchema(`type Query { hello: String }`);
|
|
|
|
const app = new Koa();
|
|
|
|
app.use(
|
|
mount(
|
|
'/graphql',
|
|
graphqlHTTP(req => {
|
|
return {
|
|
schema,
|
|
};
|
|
})
|
|
)
|
|
);
|