DefinitelyTyped/types/koa-graphql/koa-graphql-tests.ts
Matheus Gonçalves da Silva a72e5b0e7c add koa-graphql types (#36619)
* add koa-graphql types

* fix ts version

* fix tests and lint
2019-07-03 09:49:53 -07:00

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,
};
})
)
);