From b6a234377c5edea999fc23777189aad8cdf5d29f Mon Sep 17 00:00:00 2001 From: Tim Griesser Date: Wed, 11 May 2022 20:14:33 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#60275=20graphql-re?= =?UTF-8?q?solve-batch:=20add=20info=20param=20&=20remove=20dependency=20o?= =?UTF-8?q?n=20graphql@14=20by=20@tgriesser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * graphql-resolve-batch: fix types & remove dependency * change to dependencies * fix test & types * add es2018.asyncgenerator to lib * bump ts version to 4.1 to work w/ graphql@16.x * change es6 to es2018 in lib --- types/graphql-resolve-batch/graphql-resolve-batch-tests.ts | 4 +++- types/graphql-resolve-batch/index.d.ts | 5 +++-- types/graphql-resolve-batch/package.json | 4 ++-- types/graphql-resolve-batch/tsconfig.json | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts b/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts index 51f89644235ba0..a12fe7c0b07268 100644 --- a/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts +++ b/types/graphql-resolve-batch/graphql-resolve-batch-tests.ts @@ -79,7 +79,9 @@ const withSourceAndArgsAndResultTyped = createBatchResolver< SomeTestSource, SomeTestResult, SomeTestArgs ->(async (sources, args, _) => { +>(async (sources, args, _, info) => { + // $ExpectType GraphQLResolveInfo + const verifyInfo = info; // $ExpectType ReadonlyArray const verifySources = sources; // $ExpectType string diff --git a/types/graphql-resolve-batch/index.d.ts b/types/graphql-resolve-batch/index.d.ts index 2baa60d248511d..cd985ed3d111ba 100644 --- a/types/graphql-resolve-batch/index.d.ts +++ b/types/graphql-resolve-batch/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/calebmer/graphql-resolve-batch#readme // Definitions by: Rutger Hendrickx // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 4.1 import { GraphQLResolveInfo } from 'graphql'; @@ -38,7 +38,8 @@ export function createBatchResolver< export type ResolverFunction = ( source: TSource, args: TArgs, - context: TContext + context: TContext, + info: GraphQLResolveInfo ) => Promise; /** diff --git a/types/graphql-resolve-batch/package.json b/types/graphql-resolve-batch/package.json index 1e9e9301264d7b..db2dac9ca7a299 100644 --- a/types/graphql-resolve-batch/package.json +++ b/types/graphql-resolve-batch/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "graphql": "^14.5.3" + "graphql": ">=14" } -} +} \ No newline at end of file diff --git a/types/graphql-resolve-batch/tsconfig.json b/types/graphql-resolve-batch/tsconfig.json index ef3f8a1dc8b0f2..b93bc3c998e7eb 100644 --- a/types/graphql-resolve-batch/tsconfig.json +++ b/types/graphql-resolve-batch/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6", "esnext.asynciterable"], + "lib": ["es2018"], "strictFunctionTypes": true, "noImplicitAny": true, "noImplicitThis": true,