Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#60275 graphql-resolve-batch: add info para…
Browse files Browse the repository at this point in the history
…m & remove dependency on graphql@14 by @tgriesser

* 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/ [email protected]

* change es6 to es2018 in lib
  • Loading branch information
tgriesser authored May 12, 2022
1 parent fe81c93 commit b6a2343
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion types/graphql-resolve-batch/graphql-resolve-batch-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const withSourceAndArgsAndResultTyped = createBatchResolver<
SomeTestSource,
SomeTestResult,
SomeTestArgs
>(async (sources, args, _) => {
>(async (sources, args, _, info) => {
// $ExpectType GraphQLResolveInfo
const verifyInfo = info;
// $ExpectType ReadonlyArray<SomeTestSource>
const verifySources = sources;
// $ExpectType string
Expand Down
5 changes: 3 additions & 2 deletions types/graphql-resolve-batch/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Project: https://github.com/calebmer/graphql-resolve-batch#readme
// Definitions by: Rutger Hendrickx <https://github.com/nayni>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
// TypeScript Version: 4.1

import { GraphQLResolveInfo } from 'graphql';

Expand Down Expand Up @@ -38,7 +38,8 @@ export function createBatchResolver<
export type ResolverFunction<TSource, TArgs, TContext, TReturn> = (
source: TSource,
args: TArgs,
context: TContext
context: TContext,
info: GraphQLResolveInfo
) => Promise<TReturn>;

/**
Expand Down
4 changes: 2 additions & 2 deletions types/graphql-resolve-batch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
"graphql": "^14.5.3"
"graphql": ">=14"
}
}
}
2 changes: 1 addition & 1 deletion types/graphql-resolve-batch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "esnext.asynciterable"],
"lib": ["es2018"],
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down

0 comments on commit b6a2343

Please sign in to comment.