From 524db8f3c6884682bb3b2ac63017ad77a8dd6d9e Mon Sep 17 00:00:00 2001 From: Mike Marcacci Date: Wed, 27 Mar 2019 11:54:49 -0700 Subject: [PATCH] Add graphql-api-koa --- .../graphql-api-koa/graphql-api-koa-tests.ts | 0 types/graphql-api-koa/index.d.ts | 26 +++++++++++++++++++ types/graphql-api-koa/tsconfig.json | 22 ++++++++++++++++ types/graphql-api-koa/tslint.json | 1 + 4 files changed, 49 insertions(+) create mode 100644 types/graphql-api-koa/graphql-api-koa-tests.ts create mode 100644 types/graphql-api-koa/index.d.ts create mode 100644 types/graphql-api-koa/tsconfig.json create mode 100644 types/graphql-api-koa/tslint.json diff --git a/types/graphql-api-koa/graphql-api-koa-tests.ts b/types/graphql-api-koa/graphql-api-koa-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/graphql-api-koa/index.d.ts b/types/graphql-api-koa/index.d.ts new file mode 100644 index 0000000000..06053afbfb --- /dev/null +++ b/types/graphql-api-koa/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for graphql-api-koa 2.0 +// Project: https://github.com/jaydenseric/graphql-api-koa#readme +// Definitions by: Mike Marcacci +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { GraphQLSchema } from "graphql"; +import { Middleware, ParameterizedContext } from "koa"; + +interface ExecuteOptions { + schema?: GraphQLSchema; + rootValue?: any; + contextValue?: any; + fieldResolver?: any; +} + +export const errorHandler: () => Middleware< + StateT, + CustomT +>; + +export const execute: ( + options: ExecuteOptions & { + override?: (ctx: ParameterizedContext) => ExecuteOptions; + } +) => Middleware; diff --git a/types/graphql-api-koa/tsconfig.json b/types/graphql-api-koa/tsconfig.json new file mode 100644 index 0000000000..0c688ac061 --- /dev/null +++ b/types/graphql-api-koa/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "graphql-api-koa-tests.ts" + ] +} diff --git a/types/graphql-api-koa/tslint.json b/types/graphql-api-koa/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/graphql-api-koa/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }