mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
22 lines
502 B
TypeScript
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";
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
}));
|