Fix MORE lint errors

This commit is contained in:
Mike Marcacci 2019-03-27 13:03:37 -07:00
parent a8782e7078
commit 7355fe1925
2 changed files with 26 additions and 4 deletions

View File

@ -1,3 +1,27 @@
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql";
import { execute } from "graphql-api-koa";
execute({
schema: new GraphQLSchema({
query: new GraphQLObjectType({
name: "Query",
fields: () => ({
hello: {
type: GraphQLString,
resolve() {
return "world";
}
}
})
})
})
});
/* This is the thest that SHOULD exist here... but for whatever reason, the
DefinitelyTyped repo always errors with:
Module '"/Users/mike/Code/DefinitelyTyped/types/koa/index"' has no default export.
import Koa from "koa";
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from "graphql";
import { errorHandler, execute } from "graphql-api-koa";
@ -19,3 +43,4 @@ const app = new Koa()
})
})
}));
*/

View File

@ -14,10 +14,7 @@ export interface ExecuteOptions {
fieldResolver?: any;
}
export function errorHandler<StateT = any, CustomT = {}>(): Middleware<
StateT,
CustomT
>;
export function errorHandler(): Middleware;
export function execute<StateT = any, CustomT = {}>(
options: ExecuteOptions & {