Skip to content

Commit 76b63ea

Browse files
author
hirsch88
committed
rename variable
1 parent a6b8a47 commit 76b63ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/graphql/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export * from './container';
3131
export interface CreateDataLoaderOptions {
3232
method?: string;
3333
key?: string;
34-
batch?: boolean;
34+
multiple?: boolean;
3535
}
3636

3737
/**
@@ -57,7 +57,7 @@ export function createDataLoader<T>(obj: ObjectType<T>, options: CreateDataLoade
5757
items = await repository.findByIds(ids);
5858
}
5959

60-
const handleBatch = (arr: any[]) => options.batch === true ? arr : arr[0];
60+
const handleBatch = (arr: any[]) => options.multiple === true ? arr : arr[0];
6161
return ids.map(id => handleBatch(items.filter(item => item[options.key || 'id'] === id)));
6262
});
6363
}

src/loaders/graphqlLoader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const graphqlLoader: MicroframeworkLoader = (settings: MicroframeworkSett
2121
petsByUserIds: createDataLoader(PetRepository, {
2222
method: 'findByUserIds',
2323
key: 'userId',
24-
batch: true,
24+
multiple: true,
2525
}),
2626
},
2727
});

0 commit comments

Comments
 (0)