DefinitelyTyped/types/graphql-api-koa/graphql-api-koa-tests.ts
2019-04-02 22:54:29 -07:00

22 lines
502 B
TypeScript

import Koa from "koa";
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql";
import { errorHandler, execute } from "graphql-api-koa";
const app = new Koa()
.use(errorHandler())
.use(
execute({ schema: new GraphQLSchema({
query: new GraphQLObjectType({
name: "Query",
fields: () => ({
hello: {
type: GraphQLString,
resolve() {
return "world";
}
}
})
})
})
}));