Skip to content

Commit 2f1a6ae

Browse files
committed
Change sources type to standard array
1 parent cd82586 commit 2f1a6ae

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

types/graphql-resolve-batch/graphql-resolve-batch-tests.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const withSourceAndResultTyped = createBatchResolver<
5757
SomeTestSource,
5858
SomeTestResult
5959
>((sources, _, __) => {
60-
// $ExpectType ReadonlyArray<SomeTestSource>
60+
// $ExpectType SomeTestSource[]
6161
const verifySources = sources;
6262

6363
return batchFunction(sources);
@@ -68,7 +68,7 @@ const withSourceAndResultTypedAsPromise = createBatchResolver<
6868
SomeTestSource,
6969
SomeTestResult
7070
>(async (sources, _, __) => {
71-
// $ExpectType ReadonlyArray<SomeTestSource>
71+
// $ExpectType SomeTestSource[]
7272
const verifySources = sources;
7373
const result = await asyncBatchFunction(sources);
7474
return result;
@@ -80,7 +80,7 @@ const withSourceAndArgsAndResultTyped = createBatchResolver<
8080
SomeTestResult,
8181
SomeTestArgs
8282
>(async (sources, args, _) => {
83-
// $ExpectType ReadonlyArray<SomeTestSource>
83+
// $ExpectType SomeTestSource[]
8484
const verifySources = sources;
8585
// $ExpectType string
8686
const verifyArgs = args.someArg;
@@ -96,7 +96,7 @@ const withSourceAndArgsAndContextTyped = createBatchResolver<
9696
SomeTestArgs,
9797
SomeTestContext
9898
>(async (sources, args, context, info) => {
99-
// $ExpectType ReadonlyArray<SomeTestSource>
99+
// $ExpectType SomeTestSource[]
100100
const verifySources = sources;
101101
// $ExpectType string
102102
const verifyArgs = args.someArg;
@@ -112,7 +112,7 @@ const withSourceAndArgsAndContextTyped = createBatchResolver<
112112
// $ExpectType ResolverFunction<SomeTestSource, any, any, SomeTestResult[]>
113113
const withResultIsArray = createBatchResolver<SomeTestSource, SomeTestResult[]>(
114114
(sources, _, __) => {
115-
// $ExpectType ReadonlyArray<SomeTestSource>
115+
// $ExpectType SomeTestSource[]
116116
const verifySources = sources;
117117

118118
return asyncBatchFunctionWhenTReturnIsArray(sources);

types/graphql-resolve-batch/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55
// TypeScript Version: 2.6
66

7-
import { GraphQLResolveInfo } from 'graphql';
7+
import { GraphQLResolveInfo } from "graphql";
88

99
/**
1010
* Creates a GraphQL.js field resolver that batches together multiple resolves
@@ -45,7 +45,7 @@ export type ResolverFunction<TSource, TArgs, TContext, TReturn> = (
4545
* A batch function to resolve all fields for the given sources in a single batch.
4646
*/
4747
export type BatchResolveFunction<TSource, TArgs, TContext, TReturn> = (
48-
sources: ReadonlyArray<TSource>,
48+
sources: TSource[],
4949
args: TArgs,
5050
context: TContext,
5151
info: GraphQLResolveInfo

0 commit comments

Comments
 (0)